-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdp.py
More file actions
31 lines (27 loc) · 907 Bytes
/
dp.py
File metadata and controls
31 lines (27 loc) · 907 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
import shell
import devp
import sys
import os
from standlibs import pretzel, time
pretzel.init("tk_pretzel")
time.init("time")
if os.path.exists('dp_old.exe'):
os.remove('dp_old.exe')
if __name__ == '__main__':
args = sys.argv[1:]
if len(args) == 1:
if args[0] == 'help':
print("dp -> Open venv\ndp help -> List commands\ndp docs -> Link to documentation\ndp <file> -> Run file")
elif args[0].endswith('.devp'):
os.chdir(os.path.dirname(os.path.realpath(__file__)))
fn = args[0]
if os.path.exists(fn):
result, error = devp.run(fn, open(fn, 'r').read())
if error:
print(error.as_string())
else:
print("File does not exist.")
elif args[0] == 'docs':
input("Documentation: https://bit.ly/3vM8G0a")
else:
shell.shell()