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