Convert list to sequence of variables
- by wtzolt
I was wondering if this was possible...
I have a sequence of variables that have to be assigned to a do.something (a, b) a and b variables accordingly.
Something like this:
# # Have a list of sequenced variables.
list = 2:90 , 1:140 , 3:-40 , 4:60
# # "Template" on where to assign the variables from the list.
do.something (a,b)
# # Assign the variables from the list in a sequence with possibility of "in between" functions like print and time.sleep() added.
do.something (2,90)
time.sleep(1)
print "Did something (%d,%d)" % (# # vars from list?)
do.something (1,140)
time.sleep(1)
print "Did something (%d,%d)" % (# # vars from list?)
do.something (3,-40)
time.sleep(1)
print "Did something (%d,%d)" % (# # vars from list?)
do.something (4,60)
time.sleep(1)
print "Did something (%d,%d)" % (# # vars from list?)
Any ideas?