User:Nights192/Magritte

This is an interpreter for Magritte.

import os import cStringIO import sys
 * 1) Programmed by Robert H. Hofrichter, 2011.##

mode = raw_input("Is this program in 'file' or 'terminal' mode?\n") if mode == "terminal": while 12 > 11: cmd = raw_input(">") if cmd == "Ceci n'est pas un programme.": print "Ceci n'est pas un programme." else: print "Error: Program is invalid." if mode == "file": mfile = raw_input("Please enter the file to run.\n") if os.path.exists(mfile): if open(mfile) == "Ceci n'est pas un programme.": print "Ceci n'est pas un programme." raw_input("\n") else: print "Error: File does not exist." raw_input("\n")