Monthly Archives: February 2012

python:目录与文件操作

os.listdir(dirname):列出dirname下的目录和文件os.getcwd():获得当前工作目录os.curdir:返回但前目录(’.’)os.chdir(dirname):改变工作目录到dirname os.path.isdir(name):判断name是不是一个目录,name不是目录就返回falseos.path.isfile(name):判断name是不是一个文件,不存在name也返回falseos.path.exists(name):判断是否存在文件或目录nameos.path.getsize(name):获得文件大小,如果name是目录返回0Los.path.abspath(name):获得绝对路径os.path.normpath(path):规范path字符串形式os.path.split(name):分割文件名与目录(事实上,如果你完全使用目录,它也会将最后一个目录作为文件名而分离,同时它不会判断文件或目录是否存在)os.path.splitext():分离文件名与扩展名os.path.join(path,name):连接目录与文件名或目录os.path.basename(path):返回文件名os.path.dirname(path):返回文件路径

Posted in Uncategorized | Leave a comment

abaqus python tip

session.writeFieldReport does not work, the reason is not showing on the viewport.abaqus python is a great tool but too many small bugs. abaqus should update these small bugs in the futhure

Posted in Uncategorized | Leave a comment