-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerated_script.py
More file actions
22 lines (22 loc) · 824 Bytes
/
generated_script.py
File metadata and controls
22 lines (22 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from built_in import custom_input, custom_print, load_dict_from_file, read_list_from_file, void
import sys
import traceback
line_map = load_dict_from_file('line_map.txt')
lines = read_list_from_file('get_line.txt')
try:
name = void()
custom_print("Enter your name: ")
name = custom_input()
custom_print("buona giornata, ",name)
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
tb = traceback.extract_tb(e.__traceback__)
print('-------------')
print(f'Runtime Error: {e}')
for frame in tb:
_, line_number, func_name, text = frame
if func_name == '<module>':
func_name = 'galaxy()'
print(f'File <{func_name}>, line {line_map[str(line_number)]}')
index = int(line_map[str(line_number)])
print(f'{lines[index-1]}')