First Python pr...LOGIN

First Python program

Python code can be written using a text editor. Bencaogen uses Sublime Text. The first Python program is of course Hello Python. Print this sentence.

Note that there should not be any spaces in front of print, and finally save it. You can see that after Python is saved, it will be a file with a .py suffix.

ad8112d91ef20d52284e55f035f9e01.png

Finally, you can open the command line window, switch the current directory to the directory where HelloPython.py is located, and then run the program. The following is the result of the operation.

ea7d11c313b8b99e2917109d3f445dd.png

Of course, if you are using Sublime Text and configured the environment variables when installing Python, you can just press Ctrl B to run it. The running results are as follows:

fd961cc18a5a40447a39a550923449f.png


Next Section
submitReset Code
ChapterCourseware