Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

About the operation method of editor in Python

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report