In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about how to choose a Python editor correctly, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
After a long time to learn the Python editor, so to share with you, after reading this article you must have a lot of gains, I hope this article can teach you more things, learning Python editor, you may encounter Python editor problems, here will introduce the solution to the Python editor problem, take it out here to share with you.
You pick an editor just as you pick a car you will buy. A good editor will help you write Python programs easily, make your programming journey more comfortable, and help you reach your destination more quickly and safely.
One of the basic requirements of the editor is the syntax highlighting function, which allows different parts of your Python program to be marked with different colors, so that you can better see your program and visualize its operation. If you use Windows, then I suggest you use IDLE. IDLE has syntax highlighting and many other features, such as allowing you to run your program in IDLE.
It is particularly worth noting that do not use Notepad-- it is a bad choice because it does not have syntax highlighting and, more importantly, it does not support text indentation. And we will see that text indentation is extremely important to us. A good editor, such as IDLE (and VIM), will automatically help you do these things.
If you use Linux/FreeBSD, you have many options. If you are an experienced programmer, you must already be using VIM or Emacs. There is no doubt that they are two large editors with * functions. Use them to write your Python programs, and you will benefit from them. I personally use VIM to write most of my programs.
If you are a beginner programmer, you can use Kate, which is also one of my favorite editors. As long as you are willing to take the time to learn to use VIM or Emacs, I strongly recommend that you learn either of them, because they are extremely helpful to you in the long run.
If you are looking for other editors to choose from, you can take a look at the detailed list of Python editors and make your choice. You can also use Python's IDE (integrated development environment). Please take a look at the detailed list of IDE that supports Python for detailed information. Once you start writing large Python programs, IDE is really useful.
Once again, please choose the right editor-- it makes writing Python programs more interesting and convenient. Using the source file, now let's start programming again. When you learn a new programming language, it has become a tradition that the programs you write and run are usually "Hello World" programs.
When you run the "Hello World" program, all it does is say "Hello World". As Simon Cozens [1], who proposed the "Hello World" program, said: "it is the traditional mantra of the god of programming and can help you learn the language better." If you get the same output as shown above, congratulations-you have successfully run your Python program. In case you get an error, make sure that the program you typed is correct.
Then run the program again. Note that Python is case-sensitive, that is, print is different from Print-- notice that the first is lowercase p and the second is uppercase P. Also, make sure there are no spaces or tabs before the opening character of each line-- we'll discuss why this is important later. Let's think about the first two lines of this program. They are called comments-anything to the right of the # symbol is a comment. Comments are mainly used as notes for program readers.
The Python should have at least a special form of comment like the * * line. It is called the organization line-the first two characters of the source file are #!, followed by a program. This line tells your Linux/Unix system which interpreter it should run when you execute your program. This will be explained in more detail in the next section.
Note that you can always run your program on any platform by specifying an interpreter directly on the command line. It's like ordering python helloworld.py. Use annotations properly in your program to explain some important details-this will help your program's readers easily understand what the program is doing. Remember, this reader may be you in 6 months!
The comment is followed by a Python statement-- it just prints the text "Hello World". Print is actually an operator, and "Hello World" is called a string-- don't worry, we'll explain these terms in more detail later.
If you want help with operators like print, you need to set the PYTHONDOCS environment variable correctly. This can be easily done with the env command in Linux/Unix.
$env PYTHONDOCS=/usr/share/doc/python-docs-2.3.4/html/ python Python 2.3.4 (# 1, Oct 26 2004, 16:42:40) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. > help ('print')
You should have noticed that I deliberately used quotation marks on "print" so that Python could understand that I wanted help on "print" rather than printing. Note that the location I use is in the Fedora Core 3 Linux-- it may vary from release to release and release to release.
The above is how to choose a Python editor correctly. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.