-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmdPrompt.py
More file actions
37 lines (33 loc) · 798 Bytes
/
cmdPrompt.py
File metadata and controls
37 lines (33 loc) · 798 Bytes
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
import Commands as cmd
import subprocess as sp #Use this later as it seems more complex but worth it
print("\n")
cmd.start()
a = str(input(cmd.current()))
while a!= "exit":
x = a.split()
if not x:
a = str(input(cmd.current()))
continue
elif x[0] == "cd": #works
cmd.cd(a)
elif x[0] == "ls": # works
cmd.ls()
elif x[0] == "run": #works?
cmd.run(a)
elif x[0] == "touch": #works
cmd.touch(a)
elif x[0] == "rm":
cmd.rm()
elif x[0] == "mkdir":
cmd.mkdir(a)
elif x[0] == "mv":
cmd.mv(a)
elif x[0] == "cp":
cmd.cp(a)
elif x[0] == "rmdir":
cmd.rmdir(a)
elif x[0] == "findext":
cmd.findext(a)
else:
cmd.search(a)
a = str(input(cmd.current()))