Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How do I run a python script?

  1. Sep 30, 2014 #1
    I downloaded a script for python and have no idea how to run it.

    Do I go into the python GUI or the windows command prompt? Is there any way I can use this in github?

    Someone told me on another forum said the following.

    1. cd /path/to/file
    2. python script.py <options here>

    Which commands do I type in and where? Please help me out!
     
  2. jcsd
  3. Sep 30, 2014 #2

    ShayanJ

    User Avatar
    Gold Member

    That instruction should work if the path to the python.exe file is added to the PATH environmental variable.(Which I think is done automatically when installing python on windows).
    Just press windows button+r or go to start->run and type cmd. The command prompt window(a black window with white texts on it) opens. Then you should go into the partition containing the file, so you should type D: (if the file is in the D partition). Then you cd to the path of the file and then type python "filename".py.
     
  4. Sep 30, 2014 #3

    Borg

    User Avatar
    Gold Member

    To check your settings in the command prompt window, type the word 'set' and hit return. That will display all of your settings, including your PATH settings.
     
  5. Sep 30, 2014 #4
    Also, could someone please explain to me how to run a cloned repository in github?
     
  6. Sep 30, 2014 #5

    Borg

    User Avatar
    Gold Member

    I'm not sure what you mean by running a cloned repository. Do you mean cloning a repository? Have you looked at the Working with GitHub repositories help page?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: How do I run a python script?
  1. Run Python on Windows (Replies: 6)

  2. Python Script (Replies: 2)

Loading...