Dec-04-2018, 03:47 AM
(This post was last modified: Dec-04-2018, 05:48 AM by Gribouillis.)
Hi, I'm a brand new user of Python and I'm having some trouble with import statements.
I have the following code which works perfectly fine inside the IDE (PyCharm) and also outside of it when I use the .py file directly from the directory.
-------------------------
However, when I add another import statement.. It stops working?
(I also went into settings and installed the package before I did that)
-------------------------
The code actually runs perfectly fine inside the IDE but it doesn't outside of it.
Outside the IDE, the console opens momentarily and then disappears as if the loop didn't even exist.
With this I suspect that it might be something wrong with the import statement..
Because it's not part of the standard Python library I'd need to do more than just that statement or something?
If anyone could help me, that'd be great!
I have the following code which works perfectly fine inside the IDE (PyCharm) and also outside of it when I use the .py file directly from the directory.
-------------------------
import time condition = 1 while condition < 50000: print(condition) condition += 1 time.sleep(1)-------------------------
However, when I add another import statement.. It stops working?
(I also went into settings and installed the package before I did that)
-------------------------
import pyautogui import time condition = 1 while condition < 50000: print(condition) condition += 1 time.sleep(1)-------------------------
The code actually runs perfectly fine inside the IDE but it doesn't outside of it.
Outside the IDE, the console opens momentarily and then disappears as if the loop didn't even exist.
With this I suspect that it might be something wrong with the import statement..
Because it's not part of the standard Python library I'd need to do more than just that statement or something?
If anyone could help me, that'd be great!