def doesItTerminate(source_code, input_data): # # In here, we analyze the file "source_code" to decide the value of # the variable whether_the_program_terminates: # - True if the program expressed in "source_code" terminates when it runs # on the given input data. # - False if the program expressed in "source_code" doesn't terminate when # it runs on the given input data. # return whether_the_program_terminates filename = raw_input("What program would you like to analyze? ") if doesItTerminate(filename, filename): while True: print "I'm in an infinite loop!" else: print "I'm going to terminate!"