-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcsh.py
54 lines (48 loc) · 1.7 KB
/
csh.py
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
47
48
49
50
51
52
53
54
# -*- coding: utf-8 -*-
"""
@Time:2025/4/9 16:13
@Auth:HEhandsome
"""
#!/usr/bin/env python3
print('''
**************************************************************
**************************************************************
Linux 运维脚本,基于csh.sh脚本进行Python重构
重构时间:2025-02-26
**************************************************************
**************************************************************
''')
def set_all():
print('Linux系统设置构建中')
def service_install():
print('服务安装构建中')
def main():
while True:
print("""
**************************************************************
**************************************************************
********* *********
********* Linux 运维脚本 *********
********* 1.设置Linux系统配置 *********
********* 2.服务安装 *********
********* 0.退出 *********
********* *********
**************************************************************
**************************************************************
""")
try:
csh_all = int(input('请输入功能菜单序号: '))
except ValueError:
print('输入错误! 请输入数字。')
continue # 继续循环,不退出
if csh_all == 1:
set_all()
elif csh_all == 2:
service_install()
elif csh_all == 0:
print("退出")
break
else:
print('输入错误!')
if __name__ == "__main__":
main()