- Traversing file system -
os.listdir(dir) - Getting file path name -
os.path.join(dir, filename):return a path that putsdirandfilenametogetheros.path.abspath(path):return the absolute path name ofpath- Test file/directory existence -
os.path.exists(path) - Create directories -
os.mkdir(dir_path) - High level file operations -
shutilmodule ; in particular file copying and removal - Running other commands from within python program -
commandsmodule commands.getstatusoutput(cmd): return a tuple(status, output)commands.getoutput(cmd)- Downloading a web page from an url to a local file -
urllibmodule: urllib.retrieve(url, local_dst_path)
http://docs.python.org/library/commands.html
http://docs.python.org/library/shutil.html
http://code.google.com/edu/languages/google-python-class/utilities.html
http://docs.python.org/library/urllib.html
No comments:
Post a Comment