-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistorySaved.py
More file actions
58 lines (47 loc) · 1.61 KB
/
Copy pathHistorySaved.py
File metadata and controls
58 lines (47 loc) · 1.61 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
import os
import time
def clear():
os.system('cls')
os.system('mode con: cols=29 lines=9')
SpremanjPovijestiOpcija = 0
while SpremanjPovijestiOpcija != '3':
clear()
print('>>> Spremanje Povijesti <<<')
print('>>> <<<')
print('>>> <<<')
print('>>> 1) Otvori Mjest <<<')
print('>>> 2) Novo <<<')
print('>>> 3) Natrag <<<')
print('>>> <<<')
print('>>> <<<')
SpremanjPovijestiOpcija = input('>>> ')
if SpremanjPovijestiOpcija =='1':
os.startfile('SavedHistory')
elif SpremanjPovijestiOpcija =='2':
with open('History.txt','r') as HistoryTXT:
SavedHistory = HistoryTXT.read()
clear()
SavedName = str(input('Unesite Ime Spremanje: '))
SavedName='SavedHistory\\' + SavedName +'.txt'
try:
with open(SavedName,'r') as Name:
test = Name.read()
Prolaz='false'
clear()
print('To ime je već zauzeto')
Odluka = input('Želiteli zamijeniti(da/ne):')
if Odluka=='da':
Prolaz='true'
elif Odluka=='ne':
Prolaz='false'
else:
os.startfile('InputERROR.py')
except:
Prolaz='true'
if Prolaz=='true':
with open(SavedName,'w') as Name:
Name.write(SavedHistory)
elif SpremanjPovijestiOpcija =='3':
SpremanjPovijestiOpcija = '3'
else:
os.startfile('InputERROR.py')