2006年09月11日 星期一 01:15
rt
2006年09月11日 星期一 04:59
duketang wrote: > rt > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese ArithmeticError Base class for arithmetic errors. AssertionError Assertion failed. AttributeError Attribute not found. DeprecationWarning Base class for warnings about deprecated features. EOFError Read beyond end of file. EnvironmentError Base class for I/O related errors. Exception Common base class for all exceptions. FloatingPointError Floating point operation failed. FutureWarning Base class for warnings about constructs that will change semantically in the future. IOError I/O operation failed. ImportError Import can't find module, or can't find name in module. IndentationError Improper indentation. IndexError Sequence index out of range. KeyError Mapping key not found. KeyboardInterrupt Program interrupted by user. LookupError Base class for lookup errors. MemoryError Out of memory. NameError Name not found globally. NotImplementedError Method or function hasn't been implemented yet. OSError OS system call failed. OverflowError Result too large to be represented. OverflowWarning Base class for warnings about numeric overflow. Won't exist in Python 2.5. PendingDeprecationWarning Base class for warnings about features which will be deprecated in the future. ReferenceError Weak ref proxy used after referent went away. RuntimeError Unspecified run-time error. RuntimeWarning Base class for warnings about dubious runtime behavior. StandardError Base class for all standard Python exceptions. StopIteration Signal the end from iterator.next(). SyntaxError Invalid syntax. SyntaxWarning Base class for warnings about dubious syntax. SystemError Internal error in the Python interpreter. Please report this to the Python maintainer, along with the traceback, the Python version, and the hardware/OS platform and version. SystemExit Request to exit from the interpreter. TabError Improper mixture of spaces and tabs. TypeError Inappropriate argument type. UnboundLocalError Local name referenced but not bound to a value. UnicodeDecodeError Unicode decoding error. UnicodeEncodeError Unicode encoding error. UnicodeError Unicode related error. UnicodeTranslateError Unicode translation error. UserWarning Base class for warnings generated by user code. ValueError Inappropriate argument value (of correct type). Warning Base class for warning categories. WindowsError MS-Windows OS system call failed. ZeroDivisionError Second argument to a division or modulo operation was zero. __import__ __import__(name, globals, locals, fromlist) -> module Import a module. The globals are only used to determine the context; they are not modified. The locals are currently unused. The fromlist should be a list of names to emulate ``from name import ...'', or an empty list to emulate ``import name''. When importing a module from a package, note that __import__('A.B', ...) returns package A when fromlist is empty, but its submodule B when fromlist is not empty. abs abs(number) -> number Return the absolute value of the argument. apply apply(object[, args[, kwargs]]) -> value Call a callable object with positional arguments taken from the tuple args, and keyword arguments taken from the optional dictionary kwargs. Note that classes are callable, as are instances with a __call__() method. Deprecated since release 2.3. Instead, use the extended call syntax: function(*args, **keywords). basestring Type basestring cannot be instantiated; it is the base for str and unicode. bool bool(x) -> bool Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed. buffer buffer(object [, offset[, size]]) Create a new buffer object which references the given object. The buffer will reference a slice of the target object from the start of the object (or at the specified offset). The slice will extend to the end of the target object (or with the specified size). callable callable(object) -> bool Return whether the object is callable (i.e., some kind of function). Note that classes are callable, as are instances with a __call__() method. chr chr(i) -> character Return a string of one character with ordinal i; 0 <= i < 256. classmethod classmethod(function) -> method Convert a function to be a class method. A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom: class C: def f(cls, arg1, arg2, ...): ... f = classmethod(f) It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument. Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin. cmp cmp(x, y) -> integer Return negative if xy. coerce coerce(x, y) -> (x1, y1) Return a tuple consisting of the two numeric arguments converted to a common type, using the same rules as used by arithmetic operations. If coercion is not possible, raise TypeError. compile compile(source, filename, mode[, flags[, dont_inherit]]) -> code object Compile the source string (a Python module, statement or expression) into a code object that can be executed by the exec statement or eval(). The filename will be used for run-time error messages. The mode must be 'exec' to compile a module, 'single' to compile a single (interactive) statement, or 'eval' to compile an expression. The flags argument, if present, controls which future statements influence the compilation of the code. The dont_inherit argument, if non-zero, stops the compilation inheriting the effects of any future statements in effect in the code calling compile; if absent or zero these statements do influence the compilation, in addition to any features explicitly specified. complex complex(real[, imag]) -> complex number Create a complex number from a real part and an optional imaginary part. This is equivalent to (real + imag*1j) where imag defaults to 0. copyright interactive prompt objects for printing the license text, a list of contributors and the copyright notice. credits interactive prompt objects for printing the license text, a list of contributors and the copyright notice. delattr delattr(object, name) Delete a named attribute on an object; delattr(x, 'y') is equivalent to ``del x.y''. dict dict() -> new empty dictionary. dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs. dict(seq) -> new dictionary initialized as if via: d = {} for k, v in seq: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) dir dir([object]) -> list of strings Return an alphabetized list of names comprising (some of) the attributes of the given object, and of attributes reachable from it: No argument: the names in the current scope. Module object: the module attributes. Type or class object: its attributes, and recursively the attributes of its bases. Otherwise: its attributes, its class's attributes, and recursively the attributes of its class's base classes. divmod divmod(x, y) -> (div, mod) Return the tuple ((x-x%y)/y, x%y). Invariant: div*y + mod == x. enumerate enumerate(iterable) -> iterator for index, value of iterable Return an enumerate object. iterable must be an other object that supports iteration. The enumerate object yields pairs containing a count (from zero) and a value yielded by the iterable argument. enumerate is useful for obtaining an indexed list: (0, seq[0]), (1, seq[1]), (2, seq[2]), ... eval eval(source[, globals[, locals]]) -> value Evaluate the source in the context of globals and locals. The source may be a string representing a Python expression or a code object as returned by compile(). The globals must be a dictionary and locals can be any mappping, defaulting to the current globals and locals. If only globals is given, locals defaults to it. execfile execfile(filename[, globals[, locals]]) Read and execute a Python script from a file. The globals and locals are dictionaries, defaulting to the current globals and locals. If only globals is given, locals defaults to it. file file(name[, mode[, buffering]]) -> file object Open a file. The mode can be 'r', 'w' or 'a' for reading (default), writing or appending. The file will be created if it doesn't exist when opened for writing or appending; it will be truncated when opened for writing. Add a 'b' to the mode for binary files. Add a '+' to the mode to allow simultaneous reading and writing. If the buffering argument is given, 0 means unbuffered, 1 means line buffered, and larger numbers specify the buffer size. Add a 'U' to mode to open the file for input with universal newline support. Any line ending in the input file will be seen as a '\n' in Python. Also, a file so opened gains the attribute 'newlines'; the value for this attribute is one of None (no newline read yet), '\r', '\n', '\r\n' or a tuple containing all the newline types seen. 'U' cannot be combined with 'w' or '+' mode. Note: open() is an alias for file(). filter filter(function or None, sequence) -> list, tuple, or string Return those items of sequence for which function(item) is true. If function is None, return the items that are true. If sequence is a tuple or string, return the same type, else return a list. float float(x) -> floating point number Convert a string or number to a floating point number, if possible. frozenset frozenset(iterable) --> frozenset object Build an immutable unordered collection. getattr getattr(object, name[, default]) -> value Get a named attribute from an object; getattr(x, 'y') is equivalent to x.y. When a default argument is given, it is returned when the attribute doesn't exist; without it, an exception is raised in that case. globals globals() -> dictionary Return the dictionary containing the current scope's global variables. hasattr hasattr(object, name) -> bool Return whether the object has an attribute with the given name. (This is done by calling getattr(object, name) and catching exceptions.) hash hash(object) -> integer Return a hash value for the object. Two objects with the same value have the same hash value. The reverse is not necessarily true, but likely. help Define the built-in 'help'. This is a wrapper around pydoc.help (with a twist). hex hex(number) -> string Return the hexadecimal representation of an integer or long integer. id id(object) -> integer Return the identity of an object. This is guaranteed to be unique among simultaneously existing objects. (Hint: it's the object's memory address.) input Provide input() for gui apps int int(x[, base]) -> integer Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If the argument is outside the integer range a long object will be returned instead. intern intern(string) -> string ``Intern'' the given string. This enters the string in the (global) table of interned strings whose purpose is to speed up dictionary lookups. Return the string itself or the previously interned string object with the same value. isinstance isinstance(object, class-or-type-or-tuple) -> bool Return whether an object is an instance of a class or of a subclass thereof. With a type as second argument, return whether that is the object's type. The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut for isinstance(x, A) or isinstance(x, B) or ... (etc.). issubclass issubclass(C, B) -> bool Return whether class C is a subclass (i.e., a derived class) of class B. When using a tuple as the second argument issubclass(X, (A, B, ...)), is a shortcut for issubclass(X, A) or issubclass(X, B) or ... (etc.). iter iter(collection) -> iterator iter(callable, sentinel) -> iterator Get an iterator from an object. In the first form, the argument must supply its own iterator, or be a sequence. In the second form, the callable is called until it returns the sentinel. len len(object) -> integer Return the number of items of a sequence or mapping. license interactive prompt objects for printing the license text, a list of contributors and the copyright notice. list list() -> new list list(sequence) -> new list initialized from sequence's items locals locals() -> dictionary Update and return a dictionary containing the current scope's local variables. long long(x[, base]) -> integer Convert a string or number to a long integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. map map(function, sequence[, sequence, ...]) -> list Return a list of the results of applying the function to the items of the argument sequence(s). If more than one sequence is given, the function is called with an argument list consisting of the corresponding item of each sequence, substituting None for missing values when not all sequences have the same length. If the function is None, return a list of the items of the sequence (or a list of tuples if more than one sequence). max max(sequence) -> value max(a, b, c, ...) -> value With a single sequence argument, return its largest item. With two or more arguments, return the largest argument. min min(sequence) -> value min(a, b, c, ...) -> value With a single sequence argument, return its smallest item. With two or more arguments, return the smallest argument. object The most base type oct oct(number) -> string Return the octal representation of an integer or long integer. open file(name[, mode[, buffering]]) -> file object Open a file. The mode can be 'r', 'w' or 'a' for reading (default), writing or appending. The file will be created if it doesn't exist when opened for writing or appending; it will be truncated when opened for writing. Add a 'b' to the mode for binary files. Add a '+' to the mode to allow simultaneous reading and writing. If the buffering argument is given, 0 means unbuffered, 1 means line buffered, and larger numbers specify the buffer size. Add a 'U' to mode to open the file for input with universal newline support. Any line ending in the input file will be seen as a '\n' in Python. Also, a file so opened gains the attribute 'newlines'; the value for this attribute is one of None (no newline read yet), '\r', '\n', '\r\n' or a tuple containing all the newline types seen. 'U' cannot be combined with 'w' or '+' mode. Note: open() is an alias for file(). ord ord(c) -> integer Return the integer ordinal of a one-character string. pow pow(x, y[, z]) -> number With two arguments, equivalent to x**y. With three arguments, equivalent to (x**y) % z, but may be more efficient (e.g. for longs). property property(fget=None, fset=None, fdel=None, doc=None) -> property attribute fget is a function to be used for getting an attribute value, and likewise fset is a function for setting, and fdel a function for del'ing, an attribute. Typical use is to define a managed attribute x: class C(object): def getx(self): return self.__x def setx(self, value): self.__x = value def delx(self): del self.__x x = property(getx, setx, delx, "I'm the 'x' property.") range range([start,] stop[, step]) -> list of integers Return a list containing an arithmetic progression of integers. range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0. When step is given, it specifies the increment (or decrement). For example, range(4) returns [0, 1, 2, 3]. The end point is omitted! These are exactly the valid indices for a list of 4 elements. raw_input Provide raw_input() for gui apps reduce reduce(function, sequence[, initial]) -> value Apply a function of two arguments cumulatively to the items of a sequence, from left to right, so as to reduce the sequence to a single value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates ((((1+2)+3)+4)+5). If initial is present, it is placed before the items of the sequence in the calculation, and serves as a default when the sequence is empty. reload reload(module) -> module Reload the module. The module must have been successfully imported before. repr repr(object) -> string Return the canonical string representation of the object. For most object types, eval(repr(object)) == object. reversed reversed(sequence) -> reverse iterator over values of the sequence Return a reverse iterator round round(number[, ndigits]) -> floating point number Round a number to a given precision in decimal digits (default 0 digits). This always returns a floating point number. Precision may be negative. set set(iterable) --> set object Build an unordered collection. setattr setattr(object, name, value) Set a named attribute on an object; setattr(x, 'y', v) is equivalent to ``x.y = v''. slice slice([start,] stop[, step]) Create a slice object. This is used for extended slicing (e.g. a[0:10:2]). sorted sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list staticmethod staticmethod(function) -> method Convert a function to be a static method. A static method does not receive an implicit first argument. To declare a static method, use this idiom: class C: def f(arg1, arg2, ...): ... f = staticmethod(f) It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin. str str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object. sum sum(sequence, start=0) -> value Returns the sum of a sequence of numbers (NOT strings) plus the value of parameter 'start'. When the sequence is empty, returns start. super super(type) -> unbound super object super(type, obj) -> bound super object; requires isinstance(obj, type) super(type, type2) -> bound super object; requires issubclass(type2, type) Typical use to call a cooperative superclass method: class C(B): def meth(self, arg): super(C, self).meth(arg) tuple tuple() -> an empty tuple tuple(sequence) -> tuple initialized from sequence's items If the argument is a tuple, the return value is the same object. type type(object) -> the object's type type(name, bases, dict) -> a new type unichr unichr(i) -> Unicode character Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff. unicode unicode(string [, encoding[, errors]]) -> object Create a new Unicode object from the given encoded string. encoding defaults to the current default string encoding. errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'. vars vars([object]) -> dictionary Without arguments, equivalent to locals(). With an argument, equivalent to object.__dict__. xrange xrange([start,] stop[, step]) -> xrange object Like range(), but instead of returning a list, returns an object that generates the numbers in the range on demand. For looping, this is slightly faster than range() and more memory efficient. zip zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)] Return a list of tuples, where each tuple contains the i-th element from each of the argument sequences. The returned list is truncated in length to the length of the shortest argument sequence.
2006年09月11日 星期一 07:56
可参见《Python技术参考大全》,有pdg版本可以下载。 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20060911/b5796eea/attachment.html
2006年09月11日 星期一 10:36
你安装的Python里面应该自己带有文档的. 如果没有请到Python.org上查看,下载. 其中Python Library Reference 2.1节就是Built-in Functions.
2006年09月11日 星期一 15:35
呵呵 谢谢 我发现以前买了一本 《Python技术参考大全》, 还没看 2006/9/11, jacob <jacob在exoweb.net>: > 你安装的Python里面应该自己带有文档的. 如果没有请到Python.org上查看,下载. > 其中Python Library Reference 2.1节就是Built-in Functions. > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese
2006年09月11日 星期一 16:41
v*ázZ]¶î[bÀ+Øfzغè¬,z»b¢q+®À¶Úânë^ºè¬7©ç¶*'Yªçx8Q+®ÄX©²+ø«¢yÑ+®ÄÅÇ©¶*'©lxYhjاú"Ñ+®ÅºÛ«yf«)à á+®È+´J뢲'uéíjبJ뢲'uìD®º+)쮺+)졪Ý"{^®»©´º(êD®º+1騯!+®Íjg®º+6Þ6H^éíyÓh´©é׺è¬ä®º+:÷«~Z0ºè¬ëÞùhÁf«)à=éÝxzÞq«b¢u®x§z·§qá+®Ñº{bá+®Ñº{bå®x§+ZÖ«tJ뢴¢-z¶ÒÊ{ZÄJ뢴²Ö±YªçxÊË^J뢴²²×¦M¦Ä®º+M«$ëDÆ+S®çÊ®º+RvèºwK¡Æ¥ºèIâr^ ç(uá+®Ô'(uá'r^ºèIâr^ºèIâr^N¶§²VxJ뢵,zµ®x§V¥¹á+®Öj¹â¢Ú0°J뢶^®â¾+"¢q+®Ýy» v"+¶v¦y¦ìjeɶ¬zËkx¢[¹÷ÞÆ¥¦åyÈkrV¬²g\(z·r©W¢je{(§*â\çb¶Ç^«mصثv+æ¡×§ºg«j×½©^ÅçWÆ+_W[^ùhj×ë£7§±ë`zÖ¶¸%¡¶¥²¬jÛk «! éi ìbv)éºØ§¶)íz¹â²)쵩Üz+,¹·%jË"µêåzybqéìzX¬¶Zj[%¢x&j;Æh§¡¸ÞrÚ¶^ݦ)®^®Üªº+kjx¬"çnqêÞêkëޮǮ§vDZëZ¶Úì'²íyÛ-jØëa¡Û-®Ë¦²ê^®Û©ër¥ë§Èkºx¡×¯j»1©à{8© éiv*ÇzZh»¢Ø§~éܶ*'v*âjºWº)mwbØ«¡¸ÞrÙb²Ú²ÚâzÛ«©ÚZmëbÍçeËh~v¦zÇ(â²)ಡûay«m®&îµë(~Ø^+ÞãyËZÚjÛk»zÊÞiÈZnW®¢´Ú®¦z{m éÚë"Ø^rêëz{lr^2nêç-¶¦¡Û¥y«m®&îµëʨÉZ²Êç-Û¶Úânë^±©Ýç.®È¯z\ 涸º×¬¡ø±¶¬zà êðÇ¢¶Æ¶¸º×¬Û«,±«m®&îµëÚÞrêì÷¥ÊØ^jÛk»zÊÛ«,±¶¬yÉZ²Ç¬ÛM:ÿßõÕÛ¤zÖ§Û¤zÜef¢Ê&?+a¢}´Ó¯ýÿ]ciʧ(mìhÁæçzÓò¶'?+a¢z+ü˺گ$^}êÞǶԢاéܶ*'²Ü)Þ±ãè²ÛÚr¶'r§zÇ¥Ël§+a¢w'Jæìr¸zǧv˱Êâmëh§+a¢w!w¬z·ª¹ë-+-²ÜIì¹»®&Þ±éݺ{.nÇ+·¢Ü)Þ±êު笶X¬¶Êr¶'rpÞµ¨¥"wèÛiÿúr¶'ræj)fjåËbú?§+a¢w!w¬zÜ)Þ±ãè²ÛÚr¶'r§zÇ¥Ël§+a¢w'Jæìr¸zǧv˱Êâmëh§+a¢w!w¬z·ª¹ë-+-²ÜIì¹»®&Þ±éݺ{.nÇ+·¢Ü)Þ±êު笶X¬¶Êr¶'rpÞµ¨¥"wèÛiÿúr¶'ræj)fjåËbú?§+a¢w!w¬yg¥r¶²nZ iº.´üËÊa¶Úý©[z»eyç.nZ rÇLÂÔD¸m¶ÿ§+a¢w'þ©z¹_éÊØhÈbëý«miÈfz{lÿm4ëOu×ý:í§|{ÏÚ¶Ög§¶f
Zeuux © 2025
京ICP备05028076号