Python-Linux系统管理
Python-Linux混合编程
-西西弗斯
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python for Linux and Unix System Administration -4 Reusing Code with the Import Statement
wes@wes:~/Documents/python/ch1$ cat new_pysysinfo.py#!/usr/bin/env python#Very short script that reuses pysysinfo_func codefrom pysysinfo_func import disk_funcimport subprocessdef tmp_space(): tmp_usage = "du" tmp_arg = "-h" .原创 2022-05-23 15:33:58 · 349 阅读 · 0 评论 -
Python for Linux and Unix System Administration -3 function
wes@wes:~/Documents/python/ch1$ cat python-5#!/usr/bin/env pythondef pyfunc(): print("Hello Function!")for i in range(5): pyfunc()wes@wes:~/Documents/python/ch1$ python python-5Hello Function!Hello Function!Hello Function!Hello Fu.原创 2022-05-23 14:26:17 · 398 阅读 · 0 评论 -
Python for Linux and Unix System Administration -2 subprocess
Subprocess modulesubprocess — Subprocess management — Python 3.10.4 documentationpython subprocess - Python Tutorialwes@wes:~/Documents/python/ch1$ cat python-3#!/usr/bin/env pythonimport subprocesssubprocess.call(["ls", "-l"])subprocess.call([.原创 2022-05-22 17:33:07 · 386 阅读 · 0 评论 -
Python for Linux and Unix System Administration -1 ping
#!/usr/bin/env pythonclass Server(object): def __init__(self,ip,hostname): self.ip = ip self.hostname = hostname def set_ip(self,ip): self.ip = ip def set_hostname(self,hostname): self.hostname = hostname .原创 2022-05-22 09:45:12 · 449 阅读 · 0 评论
分享