A summary of how to learn Python

Source: Internet
Author: User

To improve the programming efficiency, you should pay attention to Python and learn how to use Python. First, you should not regard Python as your hobby, with a deep understanding of Python, You can greatly reduce your workload.

It also makes writing code a real pleasure. Why should we focus only on the so-called orthodox languages C ++, Java, and C? Isn't our goal a pragmatic programmer?

C ++, Java, and even C # can all be seen as the same type of language: C ++ is flexible, but complicated syntax makes production efficiency low, and Java improves production efficiency, however, flexibility is lost. C # is a good balance between production efficiency and flexibility, but it is still not enough. Otherwise, the father of Boo language will not be angry with Boo.

  • Introduction to Python code
  • Analysis of Main object-oriented Python classes
  • In-depth analysis of Python object-oriented language
  • Introduction to Python Variables
  • Full parsing of Python Inheritance Issues

Python is a dynamic type and a strong type language. A dynamic type means that you no longer need to make numerous declarations for the type of each variable, because the compiler will help you make type judgments, it will determine the type of the Variable Based on the Value assignment of the variable. A strong type means that you cannot use a string as an int unless you explicitly convert it.

Python itself is compact, because space is ignored in C ++, Java, C #, and "{}" to define code blocks, if you like it, you can write all the code on one line, so you can write it as dizzy as possible.

But this is not possible in how to learn Python, because there is only one Separator in how to learn Python, namely the colon ":", and the code block is distinguished by indentation, you may not get used to this method at first, but later, you will find that this method will benefit you a lot, because you have developed a good code style.

Don't think that Python is a very academic language, although many people think it is very suitable as an entry-level language for learning programming. In fact, Python is not only suitable for beginners to learn programming, but also a powerful language. You can use it to do anything other languages can do.

Python itself is almost everywhere, and programs written in Python can run in various mainstream operating systems, even Palm. Oh, I almost forgot. Eric Raymond also told us that hackers must master four languages. The first step is Python.

Speaking of this, it seems that there is no link with production efficiency. Well, let's look at what we see is what we get. Download Python. Of course, if you cannot leave. NET in a day, you should start learning Python from IronPython.

After the installation is complete and how to learn Python or IronPythonConsole, when you see a prompt in the Interactive mode that is unique to Python >>>, enter print "Hello, world" and press enter, Hello, world appears on the screen. Now your first Python program has been compiled and executed.

Compared with C ++, Java, and even C #, is it much faster to write and execute this classic program in Python? Haha ~~~ If I make up my mind to say that Python is highly productive, you will already scold me for being a lie.

Well, it's easy. Let's try some practical code. But before that, you have to download two very famous class libraries: wxPython and Twisted. Is the download and Installation complete? Let's start our tour of Enjoy Python with you in ten minutes.

 
 
  1. from wxPython.wx import wxPySimpleApp, wxFrame  
  2. app = wxPySimpleApp()  
  3. frame = wxFrame(None, -1, "Hello World")  
  4. frame.Show(1)  
  5. app.MainLoop() 

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.