python - Multiple assignments under 'if' statement -


Why can not I make many assignments under an if statement in Python? Do I Remember Any Syntax?

I want to do this:

  files = ["file1", "file2", "file3"] print "\ nThe following files are available: \ n" For file in i = 0 files: i = i + 1 print I, file choice = int (raw_input ("Enter a file number:")) if preferred == 1: file = np .genfromtxt (files [0 ], Usecols = (1,2,3), dtype = (float), delimiter = '\ t') time = np.genfromtxt (files [0], usecols = (0), dtype = (ARR), delimiter = '\ T') Print time  

If the time is defined outside of my statement, then this option does not change as a change ... Or cat? Both the variable file and time should be defined at your block at the high block level.

Be careful with "time", because it is the name of a dragon module. You should use a variation of this name (eg time_).


Comments