function return

Fredrik Lundh fredrik at pythonware.com
Thu Sep 11 09:37:40 EDT 2008


make that:

> note that you put the "return" statement inside the loop, so returning 
> only one line is the expected behaviour.

to fix this, you can append the result strings to the data_lis list 
inside the loop:

>           result = "%s\t%s\t%s" %(id,gene_symbol,ptms)
>           data_lis.append(result)
> 
> and then return the list when done:
> 
>  >      fh.close()
>        return data_lis
> 




More information about the Python-list mailing list