标签:ogr game video index ack readline 退出 intel eth
os模块:操作系统调用的接口
--------------------------------------------------------------------------------------------
>>> os.listdir() #列出指定目录下的所有文件和子目录,包括隐藏文件,并以列表方式打印
[‘.android‘, ‘.PyCharm2016.3‘, ‘.PyCharm2017.1‘, ‘.VirtualBox‘, ‘.YYBox‘, ‘AppDa
ta‘, ‘Application Data‘, ‘Contacts‘, ‘Cookies‘, ‘Desktop‘, ‘Documents‘, ‘Downloa
ds‘, ‘Favorites‘, ‘IntelGraphicsProfiles‘, ‘Links‘, ‘Local Settings‘, ‘Lync Reco
rdings‘, ‘Music‘, ‘My Documents‘, ‘NetHood‘, ‘NTUSER.DAT‘, ‘ntuser.dat.LOG1‘, ‘n
tuser.dat.LOG2‘, ‘NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf‘, ‘NTU
SER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.re
gtrans-ms‘, ‘NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer0000000
0000000000002.regtrans-ms‘, ‘ntuser.ini‘, ‘Pictures‘, ‘PrintHood‘, ‘PycharmProje
cts‘, ‘Recent‘, ‘Saved Games‘, ‘Searches‘, ‘SendTo‘, ‘shelve_test.bak‘, ‘shelve_
test.dat‘, ‘shelve_test.dir‘, ‘Templates‘, ‘test‘, ‘Tracing‘, ‘Videos‘, ‘Virtual
Box VMs‘, ‘「开始」菜单‘]
os.remove() #删除一个文件
os.rename("oldname","newname") #重命名文件/目录
os.system("BASH COMMAND") #运行系统命令
os.path.abspath(path) #返回path规范化的绝对路径
sys模块
---------------------------------------------
sys.argv 命令行参数
List
,第一个元素是程序本身路径
sys.exit(n) 退出程序,正常退出时exit(
0
)
sys.version 获取Python解释程序的版本信息
sys.maxint 最大的
Int
值
sys.path 返回模块的搜索路径,初始化时使用PYTHONPATH环境变量的值
sys.platform 返回操作系统平台名称
sys.stdout.write(
‘please:‘
)
val
=
sys.stdin.readline()[:
-
1
]
>>> sys.argv
[‘‘]
>>> sys.path
[‘‘, ‘C:\\Users\\HW\\AppData\\Local\\Programs\\Python\\Python36\\python36.zip‘,
‘C:\\Users\\HW\\AppData\\Local\\Programs\\Python\\Python36\\DLLs‘, ‘C:\\Users\\H
W\\AppData\\Local\\Programs\\Python\\Python36\\lib‘, ‘C:\\Users\\HW\\AppData\\Lo
cal\\Programs\\Python\\Python36‘, ‘C:\\Users\\HW\\AppData\\Local\\Programs\\Pyth
on\\Python36\\lib\\site-packages‘]
标签:ogr game video index ack readline 退出 intel eth
原文地址:http://www.cnblogs.com/wolfs685/p/6886389.html