I'm writing a script in Python, but when I attempt to run it a cross cursor appears and lets me take screenshots. But that's not part of my program, and the rest of the script never executes at all!
The minimal code that produces this behavior is:
import fiona
import scipy
sleep() Function To Run Script repeatedly. So, if you do not want to use the above code and just want to run your script repeatedly then you can use the time. sleep() function. This function allows your script to keep running after sleeping for a certain amount of time.
Take screenshot with PIL in Python Similarly to the pyautogui solution, PIL allows to take a screenshot using Python in three lines of code as well.
I usually use ps -fA | grep python to see what processes are running. The CMD will show you what python scripts you have running, although it won't give you the directory of the script. Save this answer.
Nothing, because Python precompiles your script into a PYC file and launches that. However, if some kind of exception occurs, you may get a slightly misleading explanation, because line X may have different code than before you started the script.
It's a known issue which regularly happens to some.
Without a python
shebang line the script is treated as a shell script. And line import module
is treated as a command to run import
application, which is present on your system (part of ImageMagick, I guess) and makes a screenshot saving it to the specified file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With