[Python] familiar with Python

Source: Internet
Author: User
Preface

The first time I heard that python was developing a Visual Studio extension application, there was a famous open-source ide: ironpython, which was an IDE designed for ironpython Based on vsshell, it is also the best product based on vsshell. It integrates the editor and debugger. The relationship between ironpython and python is like the relationship between C ++. NET and C ++ (here is just a random analogy, there must be something wrong ).

Python Overview

It's a bit far away. In fact, for python, I have been a beginner so far. I just read the python concise tutorial and I will give you some comments and conclusions here, if you have any problems, please let me know:

1. Interpretation of Python. Do not want the native code C/C ++ to be compiled into the binary of the Target PlatformCode. "When python is executedSource codeCompiled into the byte code (bytecode) of Python, and then executed by the python virtual machine. The basic idea of this mechanism is consistent with that of Java and. net. However, what is different between Python Virtual Machine and Java or. Net Virtual Machine is that python virtual machine is a more advanced virtual machine. The level here is not generally advanced, not to say that python's virtual machine is better than Java or. net is more powerful than Java or. NET. net, Python's virtual machine is far from the real machine. Alternatively, Python virtual machine is a virtual machine with a higher abstraction level. ----- Goodspeed"

1. python is an explanatory language. The Python interpreter is used for execution, just as a Windows or Linux script requires a Script Host. Therefore, the execution speed is slower than that of native code C/C ++. Python is different from Java/C #. The latter is compiled to an intermediate language and executed by a virtual machine or a hosted module.

2. python is very cross-platform. Currently, it supports Mac OS, windows, and Linux (maybe others ), mac OS and most Linux distributions are installed with the python interpreter and Python library by default. In Windows, python can be supported through simple installation.

3. The open-source nature of python will surely open up space for it. Under the current open source trend, the benefits of open source are recognized by more and more developers, and more people are willing to contribute to open source, including python.

4. Python language features. Python's object-oriented language features inherit the characteristics of modern advanced languages. However, I personally think that python's object-oriented syntax makes me very uncomfortable with the c ++ and C # people I was born with. I am still quite used to using it after making a sound, maybe it's because I haven't switched over from the inertia of static language.

5. Rich libraries. In addition to the python standard library, many third-party GUI Libraries are being recognized. I have not tried to use these libraries yet, but I believe that the number and quality of libraries will be continuously improved due to the open source features of Python.

 

Install python in Windows

Currently, I have not practiced python in windows, but I used to install and deploy python in windows. I installed python2.5 at the time, but I found that no environment variables were configured during the installation, so that I could not directly run my script through "Python" in the command line. Of course it is not difficult to configure environment variables. In addition, I personally think Python idel in windows is not easy to use. Exit the command line mode in Windows Python: Ctrl + Z and press ENTER

 

Python in Linux

In Linux, python is almost supported by default. Python in my Ubuntu is 2.6.5. Exit the command line mode Python: Ctrl + D in linuxs.

I used to use gedit to edit Python source code files. The source code files must include the following in the first line:

#! Usr/bin/Python

Gedit is really outstanding. It also supports Python syntax highlighting and rich highlight elements. It is strongly recommended:

Too many scripting languages? Now python is available!

No matter what platform has a scripting language, there are many types, similar syntax, easy to confuse. Now we have python. As a language, python uses the following uniform method to call system commands:

1 CommandLine= "..."
2 If OS. System (CommandLine)== 0:
3 Print "Success"
4 Else:
5 Print "Failed"

You only need to construct a CommandLine!

 

Conclusion

Programming LanguageAs the development progresses, the syntax becomes more and more simple and closer to the natural language. Our generation is entangled in native code and managed code. The emergence of interpretation languages such as Python may mark the arrival of a new trend.ProgramMembers do not need to know native code at all, just as most of our generation does not understand assembly. Python may be the trend of the times.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.