Python Modules

来自开放百科 - 灰狐
跳转到: 导航, 搜索

returns a list of all module functions

>>> import os
>>> dir(os)
>>> help(os)
>>> import sys
>>> dir(sys)
>>> help(sys)

目录

Core Modules

__builtin__

__builtin__ -- Built-in objects

exceptions

Built-in Exceptions

os

os -- Miscellaneous operating system interfaces

os.path

os.path -- Common pathname manipulations

stat

stat -- Interpreting stat() results

string

string -- Common string operations

re

re -- Regular expression operations

math

math -- Mathematical functions

cmath

cmath -- Mathematical functions for complex numbers

operator

operator -- Standard operators as functions.

copy

copy -- Shallow and deep copy operations

sys

sys -- System-specific parameters and functions

atexit

atexit -- Exit handlers

time

time -- Time access and conversions

types

types -- Names for built-in types

gc

gc -- Garbage Collector interface

More Standard Modules

fileinput

fileinput -- Iterate over lines from multiple input streams

shutil

shutil -- High-level file operations

tempfile

tempfile -- Generate temporary files and directories

StringIO

StringIO -- Read and write strings as files

cStringIO

cStringIO -- Faster version of StringIO

mmap

mmap -- Memory-mapped file support

UserDict

UserDict -- Class wrapper for dictionary objects

UserList

UserList -- Class wrapper for list objects

UserString

UserString -- Class wrapper for string objects

traceback

traceback -- Print or retrieve a stack traceback

errno

errno -- Standard errno system symbols

getopt

getopt -- Parser for command line options

getpass

getpass -- Portable password input

glob

glob -- Unix style pathname pattern expansion

fnmatch

fnmatch -- Unix filename pattern matching

random

random -- Generate pseudo-random numbers

whrandom

md5

md5 -- MD5 message digest algorithm

sha

sha -- SHA-1 message digest algorithm

crypt

crypt -- Function to check Unix passwords

rotor

zlib

zlib -- Compression compatible with gzip

code

code -- Interpreter base classes

Threads and Processes

threading

threading -- Higher-level threading interface

Queue

Queue -- A synchronized queue class

thread

thread -- Multiple threads of control

commands

commands -- Utilities for running commands

pipes

pipes -- Interface to shell pipelines

popen2

popen2 -- Subprocesses with accessible I/O streams

signal

signal -- Set handlers for asynchronous events

Data Representation

array

array -- Efficient arrays of numeric values

struct

struct -- Interpret strings as packed binary data

xdrlib

xdrlib -- Encode and decode XDR data

marshal

marshal -- Internal Python object serialization

pickle

pickle -- Python object serialization

cPickle

cPickle -- A faster pickle

copy_reg

copy_reg -- Register pickle support functions

pprint

pprint -- Data pretty printer

repr

repr -- Alternate repr() implementation

base64

base64 -- RFC 3548: Base16, Base32, Base64 Data Encodings

binhex

binhex -- Encode and decode binhex4 files

quopri

quopri -- Encode and decode MIME quoted-printable data

uu

uu -- Encode and decode uuencode files

binascii

binascii -- Convert between binary and ASCII

File Formats

xml.dom

xml.dom.minidom

xml.dom.pulldom

xml.etree.ElementTree

xml.parsers.expat

xml.sax

xml.sax.handler

xml.sax.saxutils

xml.sax.xmlreader

xmlrpclib

sgmllib

sgmllib -- Simple SGML parser

htmllib

htmllib -- A parser for HTML documents

htmlentitydefs

htmlentitydefs -- Definitions of HTML general entities

formatter

formatter -- Generic output formatting

ConfigParser

ConfigParser -- Configuration file parser

netrc

netrc -- netrc file processing

shlex

shlex -- Simple lexical analysis

zipfile

zipfile -- Work with ZIP archives

gzip

gzip -- Support for gzip files

Mail and News Messages

Network Protocols

Internationalization

Multimedia Modules

Data Storage

Tools and Utilities

Platform Specific Modules

Implementation Support Modules

Other Modules

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱