Python学习足迹(4)(入门篇终结)
2004-08-09 15:09
726 查看
python种的标准库:
sys
sys.argv所有的参数。
import sys
if '-h' in sys.argv: print 'this is help\n'
sys.exit( exitcode), sys.exit(0)
sys.stdin, data=sys.stdin.readlines()
sys.stdout,
sys.stderr
sys.platform
sys.path,返回list
type
if type('abc') == types.StringType: (true)
if type('abc') == type( '' ) (true)
copy
copy.copy()浅copy
copy.deepcopy()深copy
string
string.split()
>>> import string
>>> string.split("a b c")
['a', 'b', 'c']
string.atoi(str,base)
string.atof(str)
string.atol(str,base)
string.upper()
string.lower()
string.find()找位置
string.join()合并
string.lstrip(), string.rstrip(), string.strip()
string.replace()
re正则表达式
os
os.environ['PATH'] ='/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin/:.'
os.name = 'posix'
os.getcwd()
os.listdir('/'),列出所有的dir
os.rename(oldfile, newfile)
os.chmod()
os.system('cmd'),执行命令
os.remove()
os.mkdir()
os.rmdir()
os.removedirs(),删除所有
os.path.exists(),是否存在?
os.path.isfile(),os.path.isdir()
os.path.split()
>>> os.path.split('/home/james/.vimrc')
('/home/james', '.vimrc')
time
time.time(),由Unix纪元(1970年首)到现在的秒数,UTC
time.localtime() = (2004, 8, 8, 23, 19, 53, 6, 221, 1), 年,月,日,小时,分钟,秒,周几,今年的第几天,夏时制
time.asctime() = 'Sun Aug 8 23:20:03 2004'
time.sleep()中断,秒数,象C#种的thread.sleep()
tempfile
tempfile.mktemp()产生一个临时文件
其他的库(日后研究)
mutex
signal
socket
thread
threading
zlib
gzip
urllib
httplib
ftplib
poplib
nntplib
smtplib
telnetlib
urlparse
socketserver
htmllib
xmllib
rfc82lib
base64
xdrlib(RPC)
md5
sha
posix
crypt
sys
sys.argv所有的参数。
import sys
if '-h' in sys.argv: print 'this is help\n'
sys.exit( exitcode), sys.exit(0)
sys.stdin, data=sys.stdin.readlines()
sys.stdout,
sys.stderr
sys.platform
sys.path,返回list
type
if type('abc') == types.StringType: (true)
if type('abc') == type( '' ) (true)
copy
copy.copy()浅copy
copy.deepcopy()深copy
string
string.split()
>>> import string
>>> string.split("a b c")
['a', 'b', 'c']
string.atoi(str,base)
string.atof(str)
string.atol(str,base)
string.upper()
string.lower()
string.find()找位置
string.join()合并
string.lstrip(), string.rstrip(), string.strip()
string.replace()
re正则表达式
os
os.environ['PATH'] ='/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin/:.'
os.name = 'posix'
os.getcwd()
os.listdir('/'),列出所有的dir
os.rename(oldfile, newfile)
os.chmod()
os.system('cmd'),执行命令
os.remove()
os.mkdir()
os.rmdir()
os.removedirs(),删除所有
os.path.exists(),是否存在?
os.path.isfile(),os.path.isdir()
os.path.split()
>>> os.path.split('/home/james/.vimrc')
('/home/james', '.vimrc')
time
time.time(),由Unix纪元(1970年首)到现在的秒数,UTC
time.localtime() = (2004, 8, 8, 23, 19, 53, 6, 221, 1), 年,月,日,小时,分钟,秒,周几,今年的第几天,夏时制
time.asctime() = 'Sun Aug 8 23:20:03 2004'
time.sleep()中断,秒数,象C#种的thread.sleep()
tempfile
tempfile.mktemp()产生一个临时文件
其他的库(日后研究)
mutex
signal
socket
thread
threading
zlib
gzip
urllib
httplib
ftplib
poplib
nntplib
smtplib
telnetlib
urlparse
socketserver
htmllib
xmllib
rfc82lib
base64
xdrlib(RPC)
md5
sha
posix
crypt
相关文章推荐
- [学习笔记]python入门路漫漫,小心脚滑(二)
- Python 学习入门(33)—— 内置函数
- 《用Python玩转数据》scikit-learn机器学习经典入门项目
- Python入门学习路线图
- Python快速入门学习笔记(三)——函数的定义与调用
- Python 爬虫如何入门学习?
- 【python】入门学习(二)
- python学习(4):python爬虫入门案例-爬取图片
- 【python】入门学习(六)
- python flask 学习笔记1 简单入门
- 零基础入门学习Python(5)--闲聊之Python的数据类型
- Python学习入门基础教程(learning Python)--3.3.1 Python下的布尔表达式
- Python入门学习(二)线程上
- 【2】快速入门学习python整体
- pickle存储数据-读取数据-入门---python学习笔记25
- Python Twisted 学习系列8(转载stulife最棒的Twisted入门教程)
- Python 学习入门(6)—— 网页爬虫
- Python 学习入门(36)—— @property属性
- 【零基础入门学习Python笔记013】元祖:戴上了枷锁的列表
- Python源码入门学习心得-初始化(一)