Newbie Question

John Machin sjmachin at lexicon.net
Sat Aug 20 00:50:24 CEST 2005


Tom Strickland wrote:
> I have a file that contains many lines, each of which consists of a string 
> of comma-separated variables, mostly floats but some strings. Each line 
> looks like an obvious tuple to me. How do I save each line of this file as a 
> tuple rather than a string? Or, is that the right way to go?
> 
> Thank you.
> 
> Tom Strickland 
> 
> 

You will probably be able to read the file using the csv module.

But what do you want to do with the data? Transcribe it into some other 
format just for a learning exercise?  What do you mean by "save as tuple"?

A few more clues might save you from being (a) ignored and/or (b) 
deluged with irrelevant responses from well-intentioned wanting-to-help 
people who have guessed wrongly what you are rabbiting on about ...




More information about the Python-list mailing list