The most common way to run a script is to provide the filename to the Python command. Let's assume we have a file with the unpleasant name of
ch12_script1.py in a directory named
In Linux and Mac OS X, the full name will be
Chapter_12/ch12_script1.py. In Windows, the full filename will be
Chapter_12\ch12_script1.py. We'll stick with the Linux standard filenames for the remaining examples.
Here's how we can run a script by giving the filename:
MacBookPro-SLott:Code slott$ python3 Chapter_12/ch12_script1.py Temperature °C: 8 C=8°, F=46°
This output shows the OS prompt. The
python3 command that we entered is highlighted. The prompts and the outputs from the script are also shown. This example is typical ...