Skip to content
Snippets Groups Projects
Commit 3c102862 authored by Taddeüs Kroes's avatar Taddeüs Kroes
Browse files

Fixed write-to-file function.

parent 766565a0
No related branches found
No related tags found
No related merge requests found
......@@ -25,3 +25,8 @@ if __name__ == '__main__':
print '\nOut:'
print out
if len(argv) > 2:
f = open(argv[2], 'w+')
f.write(out)
f.close()
......@@ -28,4 +28,6 @@ def write_to_file(filename, statements):
'''Convert a list of statements to valid assembly code and write it to a
file.'''
s = write_statements(statements)
open(filename, 'w+').write(s).close()
f = open(filename, 'w+')
f.write(s)
f.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment