About 363,000 results
Open links in new tab
  1. macos - How to run Python script on terminal? - Stack Overflow

    Apr 5, 2020 · Let's say your script is called my_script.py and you have put it in your Downloads folder.. There are many ways of installing Python, but Homebrew is the easiest.

  2. How to execute a file within the Python interpreter?

    Nov 6, 2023 · I'm trying to use variables and settings from that file, not to invoke a separate process. Well, simply importing the file with import filename (minus .py, needs to be in the …

  3. How can I run python in terminal on a mac? - Stack Overflow

    May 23, 2015 · What python hello.py does (if you were to run it in your terminal instead) is to execute the python interpreter, supplying your hello.py file as the code for the interpreter to …

  4. How to run a Python file in Visual Studio code from the terminal?

    Nov 28, 2022 · Create a folder where you want your script to run; Open the folder using VS Code: File -> Open Folder; Create your script and save it in the folder; Open a new terminal: …

  5. Key shortcut for running python file in VS code - Stack Overflow

    Apr 27, 2022 · The button just runs the file in a Python terminal, the default command associated with Ctrl+F5 will run the file in the Python debugger, just with the debugging turned off. – Ajean …

  6. How to execute python file in linux - Stack Overflow

    Dec 18, 2012 · #!/usr/bin/env python. to the beginning of the file and do . chmod u+rx <file> assuming your user owns the file, otherwise maybe adjust the group or world permissions..py …

  7. python - How to run a .py file in windows command line? - Stack …

    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 …

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

    then import your file so import example_file. then run the command with example_file.hello() This avoids the weird .pyc copy function that crops up every time you run python -c etc. Maybe not …

  9. windows - Python - How do you run a .py file? - Stack Overflow

    Feb 29, 2012 · Since you seem to be on windows you can do this so python <filename.py>. Check that python's bin folder is in your PATH, or you can do c:\python23\bin\python …

  10. command line - Running Python File in Terminal - Ask Ubuntu

    Change directories using cd to the directory containing the .py and run one of the following two commands: python <filename>.py # for Python 2.x python3 <filename>.py # for Python 3.x …

Refresh