Learn "python core programming" to do a bit of knowledge, easy to review (ii)

Source: Internet
Author: User

82.file () and open () have the same function and can be replaced arbitrarily.
83.UNS Universal Line break support
Using iterators after 84.python2.3 is much more efficient than xreadlines
85. Standard files (standard input, standard output (buffered output), standard error (unbuffered output), can be accessed as long as the program is executed, these files are pre-clocked. Sys.sdtin Sys.stdout Sys.stderr
86. Use getopt and optparse to handle program parameter issues
87. Types of exceptions: Nameerror, Zerodivisionerror, SyntaxError, Indexerror, Keyerror, IOError, Attributeerror ...
88. A try can have multiple except one except can also have multiple error types
89.Exception can catch all the anomalies, of course you can also except nothing, but not recommended
90.SystemExit and Keyboardinterupt are not caused by errors, we need to be careful when we judge
91.SystemExit and Keyboardinterupt, exception's mom is baseexception.
92. Exception try except can also use Else,else to indicate that all try statement segments execute successfully before the else
93.

Learn "python core programming" to do a bit of knowledge, easy to review (ii)

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.