Head First Python Learning notes (others)

Source: Internet
Author: User

I. Scope of processing

(1) Python allows you to access and read the value of a global variable in a function, but it cannot be modified. To access and modify a global variable, you must explicitly indicate your intention (see Code 1), otherwise you will throw a unboundlocalerror (the local variable is not assigned to the value of the reference) (see Code 2).

#Code 1Name="Python"defwhat_happens_here ():Print(name)GlobalName Name=name+"is fantacy!"    Print(name) what_happens_here ()Print(name)#Code 2Name="Python"defwhat_happens_here ():Print(name) name=name+"is fantacy!"    Print(name) what_happens_here ()Print(name)

II. testing framework provided by Python

(1) UnitTest module

(2) Doctest module

Third, other

(1) Object Relational Tool (ORM), NoSQL, can avoid SQL

(2) Web framework: Diango,zope,turbogears,web2py,pylons

(3) GUI programming: TKINTER,PYGTK,PYKDE,WXPYTHON,PYQT

(4) Multithreading: Python is implemented using a technique called Global interpreter lock (interpreter Lock,gil). Limits python to run only in one interpreter process and cannot take advantage of multicore/processors. See more http://www.zhihu.com/question/21219976

Head First Python Learning notes (others)

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.