Skip to content

Commit 36f10c8

Browse files
authored
I did stupid
1 parent 2f691a4 commit 36f10c8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def run(assignments="assignments.txt", open_from="peoples.txt", \
2424
2525
Both `to_write` and `to_exec` are for using this code in another
2626
file by way of importing it.
27-
2827
'''
2928

3029
with open(assignments, "r") as f:
@@ -45,7 +44,7 @@ def run(assignments="assignments.txt", open_from="peoples.txt", \
4544
outfile.write(output)
4645

4746
if to_exec:
48-
exec output
47+
exec output in globals(), locals()
4948

5049
return output
5150

@@ -56,7 +55,6 @@ def run(assignments="assignments.txt", open_from="peoples.txt", \
5655
if len(sys.argv) > 1:
5756
if len(sys.argv) > 2:
5857
run(assignments=sys.argv[1], open_from=sys.argv[2])
59-
6058
else:
6159
run(assignments=sys.argv[1])
6260
else:
@@ -65,3 +63,4 @@ def run(assignments="assignments.txt", open_from="peoples.txt", \
6563
except Exception as e:
6664
print "An exception has occurred:\n%s" % str(e)
6765

66+

0 commit comments

Comments
 (0)