Recently i downloaded a python code to automate some stuff in a game while i do errands. Problem is, i can't stop the script. First of all i copy pasted the script into a txt file then changed it to py file, which for some reason didn't want to start. After that i changed it to pyw and it worked, but, as i mentioned in the title i can't stop it. It's not in the task manager, after i run the script nothing even opens. I have to restart my PC to stop it from running over and over. Ctrl Break didn't work, Ctrl C also didn't work. At first i wanted to start it through the python executable not the script itself but after looking and looking all over i couldn't find anything about how to start a python script. Those that i did find didn't work. So how am i supposed to do?
CodePudding user response:
To stop the program : taskkill /F /IM pythonw.exe
The reason nothing opened when you clicked on the file with a .pyw
extension is because .pyw
files run in the background when you open them from file explorer. If you want a window to open use the .py
extension.
To start it from the command line just navigate to the directory through command prompt or powershell and run python yourscript.py
.