Stupid way to learn Python learning notes

Source: Internet
Author: User

Created on: 2016-02-29

Update: 02-29

Python version: 2.7

  1. %r is good for debugging because it shows the raw data of the variable, while the other symbols are used to show the output to the user;
  2. Print will not output line breaks If you add one after each line of print (comma).
  3. argv command-line arguments are strings, so it is necessary to convert int () to a number when the number is involved, raw_input () is also a string.
  4. Common ways to read and write files: close,read,readline,truncate,write
  5. There is an attribute exists in Os.path. Can be used to determine if a file exists, and the return value is bool
  6. *args: All parameters of the function are received and placed in the list named args.
  7. The ReadLine () function prints the \ n in the original text.
  8. The Seek (0) function handles bytes rather than rows, so seek (0) goes to the beginning of the file.

Stupid way to learn Python learning notes

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.