-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc!TextEditor.py
More file actions
27 lines (25 loc) · 860 Bytes
/
c!TextEditor.py
File metadata and controls
27 lines (25 loc) · 860 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
import shutil
if __name__ == "__main__":
original = r'C:\Users\PussyDestroyer\PycharmProjects\chezahernya\checker.py'
with open("c!replace.txt") as file:
array = [row.strip() for row in file]
file.close()
for n in range(1, 11, 1):
target = 'C:/Users/PussyDestroyer/PycharmProjects/chezahernya/checker'
name = 'checker'
name += str(n)
name += '.py'
target += str(n)
target += '.py'
shutil.copyfile(original, target)
data = "data = '"
data += array[n-1]
data += "'\n"
with open(name, 'r') as f:
get_all = f.readlines()
with open(name, 'w') as f:
for i, line in enumerate(get_all, 1):
if i == 22:
f.writelines(data)
else:
f.writelines(line)