Python Forum
How to Run a Python Script - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to Run a Python Script (/thread-4223.html)



How to Run a Python Script - umityayla - Jul-31-2017

Hello,

I'm new to Python programming, so don't bash me pls :D.

I got an Ubuntu server and a Windows 8.1 PC, I found a python script from github but i have no idea how can i make it run. I'd be very happy if you could help me how to run it. Have a nice day.


https://github.com/calder/mafia/


RE: How to Run a Python Script - DeaD_EyE - Jul-31-2017

Change the directory to the path, where your Script is with cd. For example when your script is on desktop in the directory develop:

Open cmd
py Desktop\develop\your_script.py
# or
cd Desktop\develop\
py your_script.py
py is the new helper tool, which launches the Python interpreter without modifying the PATH environment variable.
More about this tool: https://docs.python.org/3/using/windows.html#launcher

You can also use the graphical editor IDLE to run your program. The shortcut is F5.


RE: How to Run a Python Script - umityayla - Jul-31-2017

(Jul-31-2017, 06:37 PM)DeaD_EyE Wrote: Change the directory to the path, where your Script is with cd. For example when your script is on desktop in the directory develop:

Open cmd
py Desktop\develop\your_script.py
# or
cd Desktop\develop\
py your_script.py
py is the new helper tool, which launches the Python interpreter without modifying the PATH environment variable.
More about this tool: https://docs.python.org/3/using/windows.html#launcher

You can also use the graphical editor IDLE to run your program. The shortcut is F5.


forgive my ignorance but there are more than one files which one of the files should i set as my script/file?


RE: How to Run a Python Script - nilamo - Jul-31-2017

(Jul-31-2017, 06:39 PM)umityayla Wrote: forgive my ignorance but there are more than one files which one of the files should i set as my script/file?


That's not a script, it's a module.  It doesn't make sense to run it directly.  As is described in that page's readme, the way to use it is to make a new file, import it, set the options you want, and to then run the file you made.


RE: How to Run a Python Script - umityayla - Jul-31-2017

(Jul-31-2017, 06:51 PM)nilamo Wrote:
(Jul-31-2017, 06:39 PM)umityayla Wrote: forgive my ignorance but there are more than one files which one of the files should i set as my script/file?


That's not a script, it's a module.  It doesn't make sense to run it directly.  As is described in that page's readme, the way to use it is to make a new file, import it, set the options you want, and to then run the file you made.

now, i got it thanks.