Python命令行里一些入门的函数

习惯了linux下面的cd、pwd、等等这样便捷的改变工作目录的函数了吧,现在在python的命令行IDLE或者说是Python Shell里面如何实现呢?
下面的两个个函数就可帮你实现了。
os.chdir(path)

Change the current working directory to path.

Availability: Unix, Windows.

os.getcwd()

Return a string representing the current working directory.

Availability: Unix, Windows.

 

os.chdir("D:\\STUDY\\JAVA\\workplace\\helios\\PyTest\\test")
>>> os.getcwd
<built-in function getcwd>
>>> os.getcwd()
'D:\\STUDY\\JAVA\\workplace\\helios\\PyTest\\test'

 

posted @ 2013-03-19 10:14  OleNet  阅读(672)  评论(0编辑  收藏  举报