-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (20 loc) · 680 Bytes
/
main.py
File metadata and controls
30 lines (20 loc) · 680 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
from libs.sudocode_c import get_code
from libs.cleaner import code_cleaner, code_execute
from libs.sudocode_cpp import get_code_cpp
import sys
if(len(sys.argv) is 2):
if(__name__=='__main__'):
#print(__name__)
filename = sys.argv[1]
get_code(filename)
get_code_cpp(filename)
code_cleaner(filename[0:len(filename)-4]+".c")
code_cleaner(filename[0:len(filename)-4]+".cpp")
code_execute(filename[0:len(filename)-4]+".c")
#print(__name__)
elif(len(sys.argv) is 1):
print("Error : Too few arguments")
print("Try typing $python3 main.py path/filename.txt")
elif(len(sys.argv) > 2):
print("Error : Too many arguments")
print("You have passed more then 1 file")