About the operation method of editor in Python
With regard to the operation of the editor in Python, this article introduces in detail the corresponding analysis and solutions to this problem, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Hello world
After installing Python (my native version is 2.5.4), open IDLE (Python GUI), which is a Python interpreter, and the statements you write can be run immediately. Let's write a famous program sentence:
Print "Hello,world!" And press enter. You can see this famous saying introduced into the program world by Khamr. Select "File"-"New Window" or the shortcut key Ctrl+N in the interpreter to open a new editor. Write the following statement: print "Hello,world!" raw_input ("Press enter key to close this window")
Save as a.py file. Press F 5 and you can see the result of the program. This is the second way to run the Python programming language.
Find your saved a.py file and double-click. You can also see the results of the program. Python programs can be run directly, which is an advantage over Java.
International support
We greet the world in a different way. Create a new editor and write the following code:
Print "Welcome to Olympic China!"
Raw_input ("Press enter key to close this window")
When you save the code, the Python getting started tutorial will prompt you whether to change the character set of the file. The result is as follows: print "Welcome to Olympic China!"
Raw_input ("Press enter key to close this window")
Change the character set to a more familiar form: print "Welcome to Olympic China!" # examples in Chinese
Raw_input ("Press enter key to close this window")
The program also works well.
A convenient calculator
It is too troublesome to count with the calculator that comes with Microsoft. Open the Python interpreter and calculate directly:
This is the answer to the question about how to operate the editor in Python. I hope the above content can be of some help to everyone. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.