-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (35 loc) · 1.28 KB
/
main.py
File metadata and controls
36 lines (35 loc) · 1.28 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
#!/usr/bin/python3
#Let everyone enjoy the fun of fucking. --Chi_Tang
import requests, json, os, sys
print('Let everyone enjoy the fun of fucking.')
try:
print('Checking Internet...')
js=requests.get('https://ssmzhn.github.io/FuckComputer.json')
print('Checking git...')
if os.system('git --version')!=0:
print('Git is not found!')
sys.exit(255)
except requests.exceptions.ConnectionError:
print('Great connection!')
sys.exit(255)
ls=json.loads(js.text)
print('Welcome to FuckComputer {} in 1 (Python ver)!'.format(len(ls.keys())))
for x in range(len(ls.keys())):
print(' ({}){}'.format(x+1,list(ls.keys())[x]))
ch=int(input('Please choose a mode: '))
choice=list(ls.keys())[ch-1]
os.system('git clone https://github.com/FuckComputer/{}'.format(choice))
if ls[choice]=='cpp':
if os.system('g++ --version')!=0:
print('G++ is not found!')
sys.exit(255)
os.system('g++ {}/src/main.cpp'.format(choice))
os.system('./a.out')
elif ls[choice]=='nim':
if os.system('nim --version')!=0:
print('Nim is not found!')
sys.exit(255)
os.system('nim compile -d:release {}/src/main.nim'.format(choice))
os.system('{}/src/main'.format(choice))
elif ls[choice]=='python':
os.system('python {}/src/main.py'.format(choice))