Advertisement
jumpToSubroutine

shell.py

Sep 12th, 2020 (edited)
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. import lexer
  2.  
  3. txt = ''
  4. print("Example: (test.tst)")
  5. file = input('Type in the file name > ')
  6.  
  7. with open(file, 'r') as file:
  8.     txt = file.read()
  9.  
  10. result, error = lexer.run(txt)
  11.  
  12. file = open('output.tst', 'w+')
  13. file.write(str(result))
  14. file.close()
  15.  
  16. if error: print(error.astr())
  17. else: print("Created file 'output.tst' in file directory")
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement