Skip to content

Commit a45c6c1

Browse files
Update gui.py for mrmine
1 parent f3073a8 commit a45c6c1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

v1.0/mrmine/gui.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@
4646
==============="""
4747
}
4848

49+
def read_save():
50+
save_data = {}
51+
with open('mrmine_save.txt', 'r') as file:
52+
for line in file:
53+
line = line.strip()
54+
if '=' in line: # Ensuring there's a key-value split
55+
key, value = line.split('=', 1) # Split on first '=' to handle complex values
56+
try:
57+
# Attempt to evaluate the value for correct data types
58+
save_data[key] = eval(value)
59+
except Exception:
60+
# If eval fails, it's likely a string or ambiguous format
61+
save_data[key] = value
62+
return save_data
63+
4964
def update_GUI_func(key):
5065
if key=='q':
5166
os.system('clear')

0 commit comments

Comments
 (0)