Hi, everyone,
I'd like to read lines from a File object to do a database import.
After a lot of struggling (trying index_html and document_src and...) and finally posting the question I managed myself meanwhile: The data attribute of the file object gives me its content. Cheers, Tobias -- (sorry for any unfriendly footer added automatically... please ignore it!) Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das un- erlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
THerp@apriori.de wrote:
Hi, everyone,
I'd like to read lines from a File object to do a database import.
After a lot of struggling (trying index_html and document_src and...) and finally posting the question I managed myself meanwhile: The data attribute of the file object gives me its content.
You may run into trouble if your file is too big, because then data is not what you expect it to be (it may be practically a linked list of data chunks, for performance reasons). Use str(file.data) or str(file) to be on the save side. cheers, oliver
participants (2)
-
Oliver Bleutgen -
THerp@apriori.de