How to save and run the written Python code? In what format do you want to save it? Let's take the IDE that comes with Python as an example to talk about this problem.
Double-click the desktop ide icon to open,shortcut key ctrl nCreate a new folder, write our Python code in the newly created question markup, and write it After running F5, there will be the following prompt
Click OK, as follows,
Note : The file name of Python must end with .py, and the file type is Python files
Running result
When naming the file, The name should avoid conflict with Python keywords.
The above is the detailed content of How to save .py in python. For more information, please follow other related articles on the PHP Chinese website!