Created
May 16, 2017 08:26
-
-
Save pdonorio/27b6a78947dbae340d485b491aa82d2d to your computer and use it in GitHub Desktop.
A simple base for stupid interpreter in Python 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
def main(): | |
""" | |
A python interpreter | |
https://ruslanspivak.com/lsbasi-part1/ | |
""" | |
while True: | |
try: | |
# To run under Python3 replace 'raw_input' call | |
# with 'input' | |
text = input('do.py> ') | |
except EOFError: | |
break | |
if not text: | |
continue | |
# interpreter = Interpreter(text) | |
# result = interpreter.expr() | |
# print(result) | |
print(text) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment