raw input - Python: Making raw_input execute -
i'm new python (i'm using codecademy , 70% through,) , i'm wondering if it's possible raw_input run actual command. instance, thought use:
command = raw_input(">>> ") command
however, when run it, displays >>> , allows me type stuff, code type won't run.
is there way this?
you can use:
command = raw_input(">>> ") exec(command)
but beware user can execute anything!
Comments
Post a Comment