Appendix A
Running Python Programs
Now that you have created your Python program, how do you run it? Of course, you can run it in your development environment, but maybe you want to run it on other computers or share it with friends.
If You Have Python Installed
If all the computers you plan to use your program have Python installed, the solution is simple.
In Windows 10, open a cmd window and change to the directory where your Python program is located. Suppose you want to run the simple example hellobuttons.py. Then, just type
python hellobuttons.py
You can even use the py
shortcut and type
py hellobuttons.py
In fact, you can just type the filename alone, and the program will launch:
hellobuttons.py
If you display your files using the Windows ...
Get Python Programming with Design Patterns now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.