About 363,000 results
Open links in new tab
  1. 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 …

  2. 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 …

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

    Feb 29, 2012 · Python is an interpretive language and so you need the interpretor to run your file, much like you need java runtime to run a jar file. Share Improve this answer

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

    sh is a subprocess interface which lets you call programs as if they were functions. This is useful if you want to run a command multiple times. sh.ls("-l") # Run command normally ls_cmd = …

  5. run python script directly from command line - Stack Overflow

    #!/usr/bin/python Muddling through. You can see what python you're currently using by using the unix which command, so if you want to see where your python is coming from, use this …

  6. how to run python files in windows command prompt?

    I want to run a python file in my command prompt but it does nothing. These are the screen shots of my program i am testing with and the output the command prompt gives me.

  7. How can I make one python file run another? - Stack Overflow

    just to add a bit of detail to case #1: say you want to import fileB.py into fileA.py. assuming the files are in the same directory, inside fileA you'd write import fileB. then, inside fileA, you can …

  8. How to use Anaconda Python to execute a .py file?

    Oct 12, 2016 · (base) C:\>python command.py python: can't open file 'command.py': [Errno 2] No such file or directory I solved it this way: navigate to the exact file location using the "cd" …

  9. 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: …

  10. 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 …

Refresh