File organization structure:__init____init__. Py└──t2 ├──b.py __init__. pya.pydef Test (): Print ' t.t1.a.test () 'b.pydef Test (): Print ' t.t2.b.test () 'Perform:Python t/main.pyQuestion 1:In main.py, how do you write the test method
__call__in Python, a function is actually an object:>>> f =ABS>>> F.__name__'ABS'>>> F (-123)123because F can be called, F is called a callable object. All functions are callable objects. An instance of a class can also become a callable object,
Exception handlingAttributeerror attempts to access a tree that does not have an object, such as foo.x, but Foo has no attribute xIOError input/output exception; Basically, the file cannot be openedImporterror cannot introduce modules or packages;
Problem: Remove unwanted characters at the beginning, end, or middle of the string, for example, whitespaceSolution:1. The character is removed at the beginning or end of the string: Str.strip ()2. Remove characters from left or right start:
The main topic of this lesson
Python first Hello World program combat
Python requires user input in combat
Python Import Module
Python formatting
Conditional judgment expression real-combat
Expression for loop combat
Job
The introduction adorner is essentially a Python function that allows other functions to add extra functionality without any code changes, and the return value of the adorner is also a function object. It is often used in scenarios where there is a
__cmp__when sorting built-in data types such as int, str, Python's sorted () is sorted by the default comparison function CMP, but if you sort an instance of a group of Student classes, you must provide our own special method__cmp__():classStudent
Ii. History of PythonThird, Python 2 or 3?The difference between the number of system bits 32 bits and 64 bits32bit = maximum addressable space for memory is 2**32, 4GB64bit, =2**64 but actually does not support this great memory, 2**4x, the largest
Problem: Finding and replacing text in a case-insensitive wayWORKAROUND: Use the RE module and add the re to the various operations. IgnoreCase Marktext='UPPER python,lower python,mixed PYTHON'print (Re.findall (' Python', Text,re.
1. Login to the Super Star Mu class, chrome grab bag, simulate header, extract form hidden elements form the params.The main is the CAPTCHA image address, found in JS by Js->new date (). GetTime () timestamp dynamically generated Url,python
With...as is called the context Manager, which can perform certain operations when it enters the scope of an object and leaves. This operation is available on its ownSet.Write an example to learn:classTest ():def __init__(self): Self.text="Hello"
Introduction to jquery jquery is another excellent JavaScript library following prototype. It is a lightweight JS library, it is compatible with CSS3, also compatible with various browsers (IE 6.0+, ff1.5+, Safari 2.0+, Opera 9.0+), jQuery2.0 and
I. Review of the previous section1, Inline-blockThe default is 3px width2, Change the labelWeb small triangle creates visual effects Small triangle 3. img TagThe IMG border is displayed by default in ie, so set the boder=04.
Python exception handling and python exception
Exception Handling
AttributeError attempts to access a tree without an object, such as foo. x, but foo has no attribute xThe IOError input/output is abnormal. Basically, the file cannot be
Python3 basic data type, Python3 Data Type
Variables in Python do not need to be declared. Each variable must be assigned a value before being used. A variable is created only after being assigned a value. In Python, a variable is a variable and has
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