1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| import os
os.path.dirname(__file__) os.path.abspath(__file__) os.path.exists(path=file_name) os.path.exists(path=file_path) os.path.join(file_name, 'data') os.path.split(file_name) os.path.basename(file_name)
os.path.isfile(file_name) os.path.isdir(file_path)
os.path.isabs(file_name) os.path.getatime(file_name) os.path.getctime(file_name) os.path.getmtime(file_name)
os.path.getsize(file_name)
os.makedir(file_path) os.makedirs(file_paths)
os.rmdir(file_path) os.removedirs(file_path) os.remove(file_path)
os.listdir(file_path) os.rename(old_path, new_path)
os.stat(file_path) os.getcwd() os.chdir(file_path)
os.system("ls") os.popen('ping www.baidu.com')
os.sep os.linesep os.pathsep os.name
os.getpid() os.getppid()
|