About 250,000 results
Open links in new tab
  1. How do I run a Python program in the Command Prompt in …

    Jan 7, 2011 · Python comes with a script that takes care of setting up the windows path file for you. After installation, open command prompt cmd Go to the directory you installed Python in cd C:\Python27 Run python and the win_add2path.py script in Tools\Scripts python.exe Tools\Scripts\win_add2path.py Now you can use python as a command anywhere.

  2. How do I execute a program or call a system command?

    How do I call an external command within Python as if I had typed it in a shell or command prompt?

  3. How to run a .py file in windows command line? - Stack Overflow

    Nov 5, 2013 · I have written a simple python program using IDLE to run it from command line. I don't have permission to save .py file in python directory (C:\program files\python33) so I saved it to C:\Pyscripts.

  4. Run Python script without Windows console appearing

    Jul 27, 2016 · pythonw.exe will run the script without a command prompt. The problem is that the Python interpreter, Python.exe, is linked against the console subsystem to produce console output (since that's 90% of cases) -- pythonw.exe is instead linked against the GUI subsystem, and Windows will not create a console output window for it unless it asks for one. This article discusses GUI programming with ...

  5. How to execute a command prompt command from python

    Mar 30, 2011 · Here's a way to just execute a command line command and get its output using the subprocess module: import subprocess # You can put the parts of your command in the list below or just use a string directly. command_to_execute = ["echo", "Test"] run = subprocess.run(command_to_execute, capture_output=True) print(run.stdout) # the output "Test"

  6. How do I run Python script using arguments in windows command …

    To execute your program from the command line, you have to call the python interpreter, like this : C:\Python27>python hello.py 1 1 If you code resides in another directory, you will have to set the python binary path in your PATH environment variable, to be able to run it, too. You can find detailed instructions here.

  7. executable - run program in Python shell - Stack Overflow

    May 27, 2018 · What do you mean by "the python shell"? Did you run python from the command line? Or are you using IDLE or some other program which can also provide a Python >>> prompt?

  8. komodo - How do I run a Python program? - Stack Overflow

    Jan 18, 2023 · The command py -3 file.py always works for me, and if I want to run Python 2 code, as long as Python 2 is in my path, just changing the command to py -2 file.py works perfectly.

  9. python - Run function from the command line - Stack Overflow

    This avoids the weird .pyc copy function that crops up every time you run python -c etc. Maybe not as convenient as a single-command, but a good quick fix to text a file from the command line, and allows you to use python to call and execute your file.

  10. Windows: run python command from clickable icon

    May 13, 2016 · I have a python script I run using Cygwin and I'd like to create a clickable icon on the windows desktop that could run this script without opening Cygwin and entering in the commands by hand. how ...

Refresh