function return

Beema Shafreen beema.shafreen at gmail.com
Thu Sep 11 15:47:25 CEST 2008


thanks for your valuable comments. I could solve the problem wiht your
comments

On Thu, Sep 11, 2008 at 7:07 PM, Fredrik Lundh <fredrik at pythonware.com>wrote:

> 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
>>
>>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Beema Shafreen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080911/89a9c9c1/attachment.html>


More information about the Python-list mailing list