Python_API
lyle2000w
这个作者很懒,什么都没留下…
展开
-
Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser
API文档: This module defines a class SGMLParser which serves as the basis for parsing text files formatted in SGML (Standard Generalized Mark-up Language). In fact, it does not provide a full SGML原创 2012-04-07 15:59:13 · 422 阅读 · 0 评论 -
Python_API_String Services_re.sub
API文档:re.sub(pattern,repl,string[,count, flags])Return the string obtained by replacing the leftmost non-overlapping occurrences ofpattern instring by the replacementrepl. If the pattern isn’t原创 2012-04-05 16:56:44 · 336 阅读 · 0 评论 -
Python_API_String Services_string.lower
API文档:string.lower(s) Return a copy of s, but with upper case letters converted to lower case.翻译文档: 参数: s:目标字符串 描述: 返回一个s字符串的副本,但是所以字符都被转换为小写。例子:#! /原创 2012-04-05 15:39:45 · 307 阅读 · 0 评论 -
Python_API_String Services_string.index
API文档:string.index(s,sub[,start[,end]])Like find() but raiseValueError when the substring is not found.翻译文档: s:被匹配的字符串 sub:匹配的字符串 start:字符串的开始位置原创 2012-04-05 12:14:14 · 304 阅读 · 0 评论 -
Python_API_File and Directory Access_os.path.split
API文档:os.path.split(path)Split the pathname path into a pair, (head, tail) where tail is the last pathname component andhead is everything leading up to that. Thetail part will never contain a s原创 2012-03-28 22:20:23 · 591 阅读 · 0 评论 -
Python_Built-in Types_list.extend
API文档:array.extend(iterable) Append items from iterable to the end of the array. If iterable is another array, it must have exactly the same type code; if not, TypeError will be raised. If iterabl原创 2012-04-07 15:23:57 · 441 阅读 · 0 评论 -
python_API_getopt
getopt在PYTHON中的使用 在运行程序时,可能需要根据不同的条件,输入不同的命令行选项来实现不同的功能。目前有短选项和长选项两种格式。短选项格式为"-"加上单个字母选项;长选项为"--"加上一个单词。长格式是在Linux下引入的。许多Linux程序都支持这两种格式。在Python中提供了getopt模块很好的实现了对这两种用法的支持,而且使用简单。一、取得命令转载 2012-05-17 12:37:21 · 308 阅读 · 0 评论 -
Python_API_os.path_splitdrive_待填充
os.path.splitdrive(path)Split the pathname path into a pair (drive, tail) where drive is either a drive specification or the empty string. On systems which do not use drive specifications,drive wi原创 2012-05-23 15:58:42 · 851 阅读 · 0 评论 -
Python_API_shutil_copy_待填充
shutil.copy(src,dst)Copy the file src to the file or directorydst. Ifdst is a directory, a file with the same basename as src is created (or overwritten) in the directory specified. Permission bit原创 2012-05-23 16:03:25 · 333 阅读 · 0 评论 -
Python_API_os.path_isfile_待填充
os.path.isfile(path)Return True ifpath is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.原创 2012-05-23 16:05:25 · 320 阅读 · 0 评论 -
Python_API_zipfile.ZipFile_待填充
class zipfile.ZipFile The class for reading and writing ZIP files. See sectionZipFile Objects for constructor details.原创 2012-05-23 16:08:24 · 406 阅读 · 0 评论 -
Python_API_os_mkdir_待填充
os.mkdir(path[,mode])Create a directory named path with numeric modemode. The defaultmode is 0777 (octal). On some systems,mode is ignored. Where it is used, the current umask value is first mas原创 2012-05-23 16:01:47 · 369 阅读 · 0 评论 -
Python_API_os_remove_待填充
os.remove(path)Remove (delete) the file path. If path is a directory,OSError is raised; seermdir() below to remove a directory. This is identical to theunlink() function documented below. On Win原创 2012-05-23 16:06:25 · 411 阅读 · 0 评论 -
Python_API_os.path_relpath_待填充
os.path.relpath(path[,start])Return a relative filepath to path either from the current directory or from an optionalstart point.start defaults to os.curdir.Availability: Windows, Unix.New原创 2012-05-23 16:10:28 · 1454 阅读 · 0 评论 -
Python_API_ZipFile_write_待填充
ZipFile.write(filename[,arcname[,compress_type]])Write the file named filename to the archive, giving it the archive namearcname (by default, this will be the same asfilename, but without a driv原创 2012-05-23 16:11:52 · 914 阅读 · 0 评论 -
Python_API_ZipFile_close_待填充
ZipFile.close()Close the archive file. You must call close() before exiting your program or essential records will not be written.原创 2012-05-23 16:12:32 · 446 阅读 · 0 评论 -
Python_API_os.path_walk_待填充
os.path.walk(path,visit, arg) Calls the function visit with arguments (arg, dirname, names) for each directory in the directory tree rooted at path (includingpath itself, if it is a director原创 2012-05-23 15:57:29 · 340 阅读 · 0 评论 -
Python_API_File and Directory Access_os.path.normcase
API文档:os.path.normcase(path) Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windo原创 2012-03-24 20:18:47 · 720 阅读 · 0 评论 -
Python_API_File and Directory Access_glob.glob
API文档:globThe glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell. No tilde expansion is done, but*,?, and character ranges expressed原创 2012-03-28 22:29:06 · 372 阅读 · 0 评论 -
Python_API_Built-in Functions_globals
API文档:globals()Return a dictionary representing the current global symbol table. This is always the dictionary of the current module (inside a function or method, this is the module where it is原创 2012-04-07 17:30:15 · 387 阅读 · 0 评论 -
Python_API_String Services_re.compile
API文档:re.compile(pattern[, flags]) Compile a regular expression pattern into a regular expression object, which can be used for matching using its match() and search() methods, described below.原创 2012-04-05 18:11:45 · 292 阅读 · 0 评论 -
Python_API_String Services_string.split
API文档:string.split(s[,sep[,maxsplit]])Return a list of the words of the string s. If the optional second argumentsep is absent orNone, the words are separated by arbitrary strings of whi原创 2012-04-05 15:31:02 · 647 阅读 · 0 评论 -
Python_API_String Services_string.replace
API文档:string.replace(str, old, new[, maxreplace]) Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxreplace is given, the first原创 2012-04-05 12:46:35 · 438 阅读 · 0 评论 -
Python_API_String Services_string.count
API文档:string.count(s, sub[, start[, end]]) Return the number of (non-overlapping) occurrences of substring sub in string s[start:end]. Defaults for start and end and interpretation of negative val原创 2012-04-05 12:35:25 · 358 阅读 · 0 评论 -
Python_API_String Services_string.find
API文档:string.find(s,sub[,start[,end]])Return the lowest index in s where the substringsub is found such thatsub is wholly contained ins[start:end]. Return-1 on failure. Defaults forstart and原创 2012-04-05 11:41:22 · 324 阅读 · 0 评论 -
Python_API_File and Directory Access_os.path.splitext
API文档:os.path.splitext(path) Split the pathname path into a pair (root, ext) such that root + ext == path, and ext is empty or begins with a period and contains at most one period. Leading perio原创 2012-03-24 21:10:10 · 875 阅读 · 0 评论 -
Python_API_Built-in Types_dict.update
update([other])Update the dictionary with the key/value pairs fromother, overwriting existing keys. ReturnNone.update() accepts either another dictionary object or an iterable of key/value pairs (原创 2012-03-24 10:31:44 · 745 阅读 · 0 评论 -
Python_API_Built-in Functions_locals
API文档:locals() Update and return a dictionary representing the current local symbol table. Free variables are returned bylocals() when it is called in function blocks, but not in class原创 2012-04-07 17:17:05 · 333 阅读 · 0 评论 -
Python_API_File and Directory Access_os.path.expanduser
API文档:On Unix and Windows, return the argument with an initial component of ~ or ~user replaced by that user‘s home directory.On Unix, an initial ~ is replaced by the environment variable HOME i原创 2012-03-28 21:57:56 · 515 阅读 · 0 评论 -
Python_API_Generic Operating System Services_os.environ
os.environ是系统上定义的环境变量的字典例子:import osprint os.environ输出{'TMP': 'C:\\Users\\LYLE20~1\\AppData\\Local\\Temp', 'COMPUTERNAME': 'LENOVO-PC', '1830B7BD-F7A3-4C4D-989B-C004DE465EDE': '17a4:原创 2012-03-28 22:07:24 · 493 阅读 · 0 评论 -
Python_API_File and Directory Access_os.path.join
API文档:os.path.join(path1[, path2[, ...]]) Join one or more path components intelligently. If any component is an absolute path, all previous components (on Windows, including the previous drive原创 2012-03-24 20:47:21 · 656 阅读 · 0 评论 -
Python_API_String Services_string.strip
API文档:Return a copy of the string with leading and trailing characters removed. If chars is omitted or None, whitespace characters are removed. If given and not None, chars must be a string; the cha原创 2012-03-24 19:58:22 · 373 阅读 · 0 评论 -
Python_API_Python Runtime Services_sys.modules
sys.modules是一个字典,他包含了从Python开始运行起,被导入的所有模块。键字就是模块名,键值就是模块队形。请注意除了你的程序导入的模块外还有其他模块。Python在启动时预先装入了一些模块,如果你在一个Python IDE环境下,sys.modules包含了你在IDE中运行的所有程序所导入的模块例子:import sysprint '\n'.join(原创 2012-03-28 21:38:41 · 471 阅读 · 0 评论 -
Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser.feed
API文档: SGMLParser.feed(data) Feed some text to the parser. It is processed insofar as it consists of complete elements; incomplete data is buffered until more data is fed or close() is called.原创 2012-04-07 16:39:22 · 576 阅读 · 0 评论 -
Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser.reset
API文档:SGMLParser.reset() Reset the instance. Loses all unprocessed data. This is called implicitly at instantiation time.翻译文档: reset有SGMLParser的__init__调用,在reset进行初始化的工作。例子:#! /原创 2012-04-07 16:47:36 · 609 阅读 · 0 评论 -
Python_API_String Services_string.upper
API文档:string.upper(s) Return a copy of s, but with lower case letters converted to upper case.翻译文档:参数: s:目标字符串描述: 返回一个s字符串的副本,但是所有的字符都被转换为大写。例子:#! /usr/bin/env python原创 2012-04-05 15:43:21 · 362 阅读 · 0 评论 -
Python_API_os.path_exists_待填充
os.path.exists(path)Return True ifpath refers to an existing path. Returns False for broken symbolic links. On some platforms, this function may returnFalse if permission is not granted to exe原创 2012-05-23 16:00:25 · 900 阅读 · 0 评论