问题
So, I am extremely new to Python. I just downloaded a file from http://webprojects.eecs.qmul.ac.uk/fa303/pgs/tutorial.html. It is a PYW file. It is a recreation of the game Super Mario Brothers. I have Python 3 and Pygame already installed. The folder is on my desktop, and I am currently trying to figure out how I can run the game for a test.
Thank you.
回答1:
If you are on Windows, run the command "pythonw (name of PYW file)" from "cmd.exe". PYW files don't need cmd.exe so you can close out of it.
If you are on Linux or Mac OS X, just rename the PYW"example.PY" file to a PY file and run it from the console. Don't close the console here because it is no longer a PYW file. For the explanations, scroll down.
Explanations:
PYW files are just meant "Python Script Without Console". So running a PYW file will not show the console but running a PY file do show a console. PYW files only work in Windows and are not available in Mac and Linux systems.
来源:https://stackoverflow.com/questions/45976196/how-to-open-pyw-files-on-macos