Differences between revisions 3 and 4
Revision 3 as of 2006-04-25 06:55:54
Size: 872
Editor: Ericzhao82
Comment:
Revision 4 as of 2006-05-12 08:02:34
Size: 0
Editor: Ericzhao82
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
##master-page:HomepageTemplate
#format wiki
== Ericzhao 's Page ==
import OS 模块
getcwd() //可以获取当前工作目录的路径
chdir('目录路径') //切换工作目录
chdir(os.pardir) //回到上级目录
makedirs //用来创建目录
open('文件名') //打开文件
write('要写入的内容') //
close() //关闭文件,退出
remove('文件名') //删除文件
removedirs('目录名') //删除空目录,空的!
import shutil //引入shutil模块
shutil.rmtree //删除目录,非空目录照样删除
#Using the os Module to Get Information About a File
#使用OS模块获取文件信息
#Using the os Module to Change a File's Privileges and Timestamps
# 使用OS模块改版文件的权限和时间戳
Email: [[MailTo([email protected])]]

...

----
 . [:CategoryHomepage:Ericzhao]

Ericzhao82 (last edited 2009-12-25 07:17:38 by localhost)