-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpycmd.py
More file actions
123 lines (113 loc) · 2.93 KB
/
pycmd.py
File metadata and controls
123 lines (113 loc) · 2.93 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Imports
from time import sleep
import random
import datetime
# Variables
cmd = 1
username = 1
password = 1
admin = 0
# Command
while cmd == 1:
if admin == 0:
print("Please Login To Enable All Features")
command = input("Command:")
# Help
if command == "help":
if admin == 1:
print("Commands: time, passgen, email, github, google")
cmd = 0
else:
print("Login by typing login")
cmd = 0
# Login
if command == "login":
if username == "admin" and password =="admin":
print("Already Logged In")
cmd = 0
if username != "admin" and password !="admin":
username = input("Username:")
password = input("Password:")
if username == "admin" and password == "admin":
print("Logged In Successfully")
admin = 1
cmd = 0
if username != "admin" and password !="admin":
print("Wrong Username or Password")
cmd = 0
# Time
if command == "time":
if admin == 1:
time = datetime.datetime.now()
print("Enter [y],[m],[d],[h],[min]")
timeformat = input("Time Format:")
if timeformat == "y":
print(time.year)
cmd = 0
if timeformat == "m":
print(time.month)
cmd = 0
if timeformat == "d":
print(time.day)
cmd = 0
if timeformat == "h":
print(time.hour)
cmd = 0
if timeformat == "min":
print(time.minute)
cmd = 0
else:
print("You need to login")
cmd = 0
# Password Generater
if command == "passgen":
if admin == 1:
print("How many passwords do you want?")
passgenamount = int(input("Passwords:"))
for x in range(passgenamount):
print (random.randint(10000000,100000000))
cmd = 0
else:
print("You need to login")
cmd = 0
# Email
if command == "email":
if admin == 1:
print("What email address?")
address = input("Address:")
print("What subject?")
subject = input("Subject:")
print("What message?")
message = input("Message:")
print("Sent to:",address,"Subject:",subject,"Message:",message)
cmd = 0
else:
print("You need to login")
cmd = 0
# GitHub
if command == "github":
if admin == 1:
print("What do you want to search for?")
githubsearch = input("Search:")
print("Go to: https://github.com/search?utf8=%E2%9C%93&q=",githubsearch,"&type=", sep='')
cmd = 0
else:
print("You need to login")
cmd = 0
# Google
if command == "google":
if admin == 1:
print("What do you want to search for?")
googlesearch = input("Search:")
print("https://www.google.com/search?&q=",googlesearch, sep = '')
cmd = 0
else:
print("You need to login")
cmd = 0
# Command Finished
if cmd == 0:
print("Command Finished")
cmd = 1
# Command Not Found
else:
print(command,"is not a command")