-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlmao.py
44 lines (34 loc) · 816 Bytes
/
lmao.py
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
#!/usr/bin/env python3
import pathlib
self = pathlib.Path(__file__).resolve()
vars = {
"a": None,
"b": None,
"c": None,
}
def lmao():
newlines = []
with open(self, "r") as f:
lines = f.readlines()
start = False
for line in lines:
if line.startswith("vars = {"):
start = True
elif line.startswith("}") and start:
newlines.append(f"vars = {repr(vars)}\n")
start = False
elif not start:
newlines.append(line)
else:
continue
with open(self, "w") as f:
f.writelines(newlines)
def init_vars():
for k, v in vars.items():
if v is None:
v = input(f"{k}: ")
vars[k] = v
lmao()
if __name__ == "__main__":
init_vars()
print(vars)