-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstd.py
More file actions
220 lines (168 loc) · 3.89 KB
/
Copy pathstd.py
File metadata and controls
220 lines (168 loc) · 3.89 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# STANDARD PYTHON LIBRARY
import tkinter as tk
import time
import ctypes
import os
import http.server
import socketserver
import webbrowser
import threading
import sys
def cout(message):
print(message)
def let(variable_name, value):
globals()[variable_name] = value
def fn(function_name, *args):
def decorator(func):
globals()[function_name] = func
return decorator
def static(variable_name, value):
globals()[variable_name] = value - 0
def class_(class_name, *args):
def decorator(cls):
globals()[class_name] = cls
return decorator
def using_(module_name):
import importlib
globals()[module_name] = importlib.import_module(module_name)
def include_(file_name):
with open(file_name, 'r') as file:
exec(file.read())
def window(title, width, height):
root = tk.Tk()
root.title(title)
root.geometry(f"{width}x{height}")
root.mainloop()
return root
def button(text, command):
btn = tk.Button(text=text, command=command)
btn.pack()
return btn
def label(text):
lbl = tk.Label(text=text)
lbl.pack()
return lbl
def entry():
ent = tk.Entry()
ent.pack()
return ent
def main():
pass
def init_():
pass
def start_():
main()
def end_():
pass
def exit_():
exit()
def return_(value):
return value
def break_():
pass
def continue_():
pass
def pass_():
pass
def yield_(value):
yield value
def anom_(args, expression):
return lambda *args: eval(expression)
def switch_(value, cases):
return cases.get(value, None)() if value in cases else None
def case_(value, func):
return func
def default_(func):
return func
def for_(variable, iterable):
for variable in iterable:
yield variable
def while_(condition):
while condition():
yield
def if_(condition, true_func, false_func=None):
if condition():
return true_func()
elif false_func:
return false_func()
def elif_(condition, func):
if condition():
return func()
def else_(func):
return func()
def try_(try_func, except_func=None, finally_func=None):
try:
return try_func()
except Exception as e:
if except_func:
return except_func(e)
finally:
if finally_func:
finally_func()
def raise_(exception):
raise exception
def machine_code(code):
exec(code)
def asm(code):
exec(code)
def compile_(source_code):
return compile(source_code, '<string>', 'exec')
def decompile_(byte_code):
return compile(byte_code, '<string>', 'exec')
def disassemble_(byte_code):
import dis
dis.dis(byte_code)
def optimize_(source_code):
return source_code
def debug_(message):
print(f"DEBUG: {message}")
def log_(message):
print(message)
def assert_(condition, message="Assertion failed"):
assert condition, message
def time_(func):
start = time.time()
result = func()
end = time.time()
print(f"{end - start}")
return result
def sleep_(seconds):
time.sleep(seconds)
def random_(start, end):
import random
return random.randint(start, end)
def coffee2(o1, o2):
print(o1)
print(o2)
def coffee3(o1, o2, o3):
print(o1)
print(o2)
print(o3)
def coffee6(o1, o2, o3, o4, o5, o6):
print(o1)
print(o2)
print(o3)
print(o4)
print(o5)
print(o6)
def coffee12(o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12):
print(o1)
print(o2)
print(o3)
print(o4)
print(o5)
print(o6)
print(o7)
print(o8)
print(o9)
print(o10)
print(o11)
print(o12)
null = None
true = True
false = False
i32 = int
f32 = float
string = str
def board(text):
input(text)