a = input("tell me which py to execute: ") print(a)
print('import '+a) print(type('import'+a)) eval('print(a)') try: eval('import '+a) except Exception as e: print('Error: ', e) ##while True: ## pass @python 3.4.2 this code attempts to run a .py file that user specifies. eval() does fine with print() command but fails to call import command Is it a but or a taboo? Thanks Zhaoxun Yan Option Product Manager Gelin Dahua Futures Co.Ltd T: +86 10 56711783 -- https://mail.python.org/mailman/listinfo/python-list