当前位置:网站首页>Properties and methods of OS Library
Properties and methods of OS Library
2022-07-04 11:07:00 【It's a cinch!】
chdir: Modify working directory ——os.chdir(“path”)
curdir: Get the current directory , Return to relative path ——os.curdir
getcwd: View current directory , Return to absolute path ——os.getcwd()
chmod: Modify file or directory permissions ——os.chmod(path.mode)
cpu_count: return cpu Number of threads corresponding to the core (2 nucleus 4 Threads )——os.cpu_count()
close: Close file path ——os.close(path)
kill: Kill process by process number ( Use with caution )——os.kill(pid, sig)
getpid: Get the current process number ——os.getpid()
getppid: Returns the parent process number of the current process —— os.getppid()
linesep: Displays the newline character under the current system ——os.linesep
sep: Get the current path delimiter ——os.sep
pathsep: Get the environment variable delimiter ——os.pathsep
listdir: Return all files in the corresponding directory , Including hidden files ——os.listdir(path)
makedirs: Create directory ( It can support multi-level directories )——os.makedirs(path)
mkdir: Create directory It can only be one floor ——os.mkdir(path)
open: create a file ——file = os.open(‘filename,‘ File format ’,‘w’)
remove: Delete file ——os.remove(" file name ")
removedirs: Delete directory , Support multi-level deletion ——os.removedirs(path)
system: Execute terminal commands , stay cmd The output content will be output directly on the console , The return result is 0 Indicates successful execution ——os.system() Such as , Clear screen operation os.system(cls)
notes :os.system It's simple and rough execution cmd Instructions , If you want to get cmd Output content , You can't get it
'DirEntry', 'F_OK', 'MutableMapping', 'O_APPEND', 'O_BINARY', 'O_CREAT', 'O_EXCL', 'O_NOINHERIT', 'O_RANDOM', 'O_RDONLY', 'O_RDWR', 'O_SEQUENTIAL', 'O_SHORT_LIVED', 'O_TEMPORARY', 'O_TEXT', 'O_TRUNC', 'O_WRONLY', 'P_DETACH', 'P_NOWAIT', 'P_NOWAITO', 'P_OVERLAY', 'P_WAIT', 'PathLike', 'R_OK', 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'W_OK', 'X_OK', '_AddedDllDirectory', '_Environ', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_execvpe', '_exists', '_exit', '_fspath', '_get_exports_list', '_putenv', '_unsetenv', '_wrap_close', 'abc', 'abort', 'access', 'add_dll_directory', 'altsep', 'closerange', 'defpath', 'device_encoding', 'devnull', 'dup', 'dup2', 'environ', 'error', 'execl', 'execle', 'execlp', 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'extsep', 'fdopen', 'fsdecode', 'fsencode', 'fspath', 'fstat', 'fsync', 'ftruncate', 'get_exec_path', 'get_handle_inheritable', 'get_inheritable', 'get_terminal_size', 'getcwdb', 'getenv', 'getlogin', 'isatty', 'link', 'lseek', 'lstat', '', 'name', 'pardir', 'path', 'pipe', 'popen', 'putenv', 'read', 'readlink','rename', 'renames', 'replace', 'rmdir', 'scandir', 'set_handle_inheritable', 'set_inheritable', 'spawnl', 'spawnle', 'spawnv', 'spawnve', 'st', 'startfile', 'stat', 'stat_result', 'statvfs_result', 'strerror', 'supports_bytes_environ', 'supports_dir_fd', 'supports_effective_ids', 'supports_fd', 'supports_follow_symlinks', 'symlink', 'sys', 'terminal_size', 'times', 'times_result', 'truncate', 'umask', 'uname_result', 'unlink', 'urandom', 'utime', 'waitpid', 'walk', 'write'
边栏推荐
- Appscan installation steps
- 守护进程Xinted和日志记录Syslogd
- Using SA token to solve websocket handshake authentication
- Introduction to Lichuang EDA
- Performance test method
- Common system modules and file operations
- Post man JSON script version conversion
- QQ one click cookie acquisition
- Local MySQL forgot the password modification method (Windows)
- Canoe: the difference between environment variables and system variables
猜你喜欢
Oracle11g | getting started with database. It's enough to read this 10000 word analysis
Canoe - the second simulation engineering - xvehicle - 2 panel design (operation)
Analysis function in SQL
Discussion | has large AI become autonomous? Lecun, chief scientist of openai
DNS hijacking
Canoe - the second simulation engineering - xvehicle - 2panel design (principle, idea)
[Galaxy Kirin V10] [server] system partition expansion
Fundamentals of software testing
JMeter correlation technology
[Galaxy Kirin V10] [desktop and server] FRP intranet penetration
随机推荐
SSH原理和公钥认证
Canoe: the fourth simulation project -- bug debugging experience
Using SA token to solve websocket handshake authentication
Canoe: what is vtsystem
R built in data set
Canoe - the third simulation project - bus simulation - 3-1 project implementation
unit testing
[Galaxy Kirin V10] [desktop] printer
Test question bank management system - database design [easy to understand]
Personal thoughts on the development of game automation protocol testing tool
Locust learning record I
Day06 list job
Introduction to Lichuang EDA
20 kinds of hardware engineers must be aware of basic components | the latest update to 8.13
How to quickly parse XML documents through C (in fact, other languages also have corresponding interfaces or libraries to call)
Solaris 10 network services
Safety testing aspects
三立期货安全么?期货开户怎么开?目前期货手续费怎么降低?
QQ get group member operation time
Daemon xinted and logging syslogd