Python built-in tools

Source: Internet
Author: User
ArticleDirectory
    • Built-in functions
    • Attribute operation functions
    • Execution Program
    • Library module

 

Built-in functions
 
STR (string) returns the string representation of the object
List (SEQ)
Tuple (SEQ)
INT (x) converts a string or number to an integer.
Long (X)
Float (X)
Complex (real, image)
Hex (I)
Oct (I)
Ord (c) returns the ASCII value of a single character
CHR (I) returns characters with an ASCII value of I.
Min (I [, I] *)
Max (I [, I] *)
Attribute operation functions

The four built-in functions perform the following operations on the attributes of a namespace: existence, value, value, and deletion. It can be used for modules, classes, and instances.

 
If hasattr has an attribute, 1 is returned; otherwise, 0 is returned.
Getattr
Setattr
Delattr
Run Program
Import
Exec code [IN globaldict [, localdict]
Compile (string, filename, kind)
Execfile (filename [, globaldict [, localdict])
Eval (code [, globaldict [, localdict])
Basic string operation of the Library module: Str module Advanced string operation: re module (Regular Expression) General operating system interface: OS module copy file and directory: shutil module internat related modules:
 
Public Gateway Interface: CGI Module
Operation URL: urllib and urlparse modules
Special Internet protocols: httplib, ftplib, gopherlib, poplib, imaplib, nntplib, smtplib
Internat file processing modules: sgmllib, htmllib, xmllib, formatter, rfc822, mimetools, binhex, UU, binascii, xdrllib, mimetypes, base64, quopri, mailbox, mimify
Processing binary data: struct module debugging, time and optimization: PDB, time, profile copy: Copy module random: Random Module

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.