-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.py
More file actions
63 lines (48 loc) · 1.75 KB
/
menu.py
File metadata and controls
63 lines (48 loc) · 1.75 KB
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
55
56
57
58
59
60
61
62
63
import time
import subprocess
import os
import platform
import getmac
user_input='''
Press 1 to Check current time and Date :-
Press 2 to Check RAM Size of Your current OS :-
Press 3 to KNow Name of YOur current OS :-
Press 4 to Check What is MAc Address of YOur lapTOP/PC/VM/CLoudVM :-
Press 5 to create one directory IN your Desktop :-
Press 6 to Restart Your current OS :-
Press 7 to Print list of all available Wifi in your laptop Range :-
Press 8 to RUn another code in Your current folder :-
Press 9 to exit the loop:-
'''
while True :
print(user_input)
# to accept input from user
user_choice=input("Input Valid Choice ")
# printing user input
#print("user has entered ",user_choice)
if user_choice == '1':
# mytime=time.ctime()
print("Current time is: ",time.ctime())
elif user_choice == '2' :
print("Total RAM size is ",((os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES'))/(1024.**3)))
elif user_choice == '3' :
print("Current Name is: ",platform.system())
elif user_choice == '4' :
print("Your Mac Address Is: ",getmac.get_mac_address())
elif user_choice == '5' :
ans=input("Enter The Name of Directory:- ")
path="/home/harrypotter/Desktop/"+ans
os.mkdir(path)
elif user_choice == '6' :
print("The OS will restart after 3 Second:")
time.sleep(3)
os.system("shutdown -r now")
elif user_choice == '7' :
print("Availble Wifi are: ")
print(subprocess.getoutput("nmcli dev wifi"))
elif user_choice == '8' :
print(os.system("python3 basic.py"))
elif user_choice == '9' :
exit()
else :
print("INVALID INPUT")