Spaces:
Running
on
Zero
Running
on
Zero
__name__==__main__
Browse files
loader.py
CHANGED
@@ -139,7 +139,9 @@ def load_scripts():
|
|
139 |
try:
|
140 |
with open(last_file_path, 'r') as f:
|
141 |
script_content = f.read()
|
142 |
-
|
|
|
|
|
143 |
print(f"Successfully executed '{last_file_path}'")
|
144 |
except Exception as e:
|
145 |
print(f"Error executing the last downloaded script '{last_file_path}': {e}")
|
|
|
139 |
try:
|
140 |
with open(last_file_path, 'r') as f:
|
141 |
script_content = f.read()
|
142 |
+
globals_dict = globals()
|
143 |
+
globals_dict['__name__'] = '__main__'
|
144 |
+
exec(script_content, globals_dict)
|
145 |
print(f"Successfully executed '{last_file_path}'")
|
146 |
except Exception as e:
|
147 |
print(f"Error executing the last downloaded script '{last_file_path}': {e}")
|