I want to know if it's possible to import/include a script into other one?
In my case, my main script asked simply a choice from the user. And according to this choice, I want to include the other script.
print (30 * '-')
print (" M A I N - M E N U")
print (30 * '-')
print 'Information'
print (30 * '-')
print ("1. Choice 1")
print ("2. Choice 2")
print ("3. Choice 3")
print (30 * '-')
is_valid=0
while not is_valid :
try :
choice = int ( raw_input('Enter your choice [1-3] : ') )
is_valid = 1 ## set it to 1 to validate input and to terminate the while..not loop
except ValueError, e :
print ("'%s' is not a valid integer." % e.args[0].split(": ")[1])
if choice == 1:
# Here I want to include the other script from other file.