Please forgive me if this is too basic...I'm running Python in Linux. It's already installed and I open it through a terminal and not a separate IDLE. I've written my first program, but I don't know how to test it. I don't know how to get Python to look for it in the right place. Does that make sense?
Does cd /the/dir/it/is/in and then python3 filename.py work?
Yeah, as s3a said you can run it with "python filename.py"
Also, on Debian, I'm pretty sure "python" uses whatever is default but if you use the "python2" or "python3" command, you get to explicitly choose which version you use.
If I assume you've got a textfile with your python program, you can run it from the python console by calling `execfile( "program.py" )` (or e.g. `execfile( "../test/program.py" )` ). You can also simply call `python program.py` from your terminal. Another way, which is the way I usuallt prefer, is by putting a line in front of your script that tells the terminal how to execute it. You can then simply run your program from the terminal (e.g. ./program.py) if you make it executable. The line will be something like `#!/usr/bin/python` (and it should be the first line in your file). This will also work for perl/ruby/bash scripts.
Join our real-time social learning platform and learn together with your friends!