-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
39 lines (24 loc) · 1.02 KB
/
test.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
# # This is an example of me writing a python file, reading a python file, changing the data from the file and then writing back to the file. This is gonna be very helpful for using the user selected data from the aiBuild app to write their custom version of ai and to see what it is they are writing
# with open("my_py.py","w") as file_object:
# myVar = "class Test:\n\tstr = 'Hey!'"
# file_object.write(myVar)
# with open("my_py.py","r") as file_object:
# contents = file_object
# alist = contents.readlines()
# # print(list[1][2])
# # space_cnt = 0
# for i in range(len(alist)):
# if alist[i].startswith("\t") and alist[i].lstrip().startswith("str ="):
# print(f"Hell yeah! \n{alist[i]}")
# alist[i] = "\tstr = 'This could really work!'"
# with open("my_py.py","w") as file_object:
# myVar =""
# for line in alist:
# myVar += line
# file_object.write(myVar)
# c = {}
# c.update(test1=1)
# c.update(test2=2)
# print(c)
import os
# print(os.pardir)