On Mon, Apr 10, 2017 at 7:22 AM, john polo <jp...@mail.usf.edu> wrote:
> Thanks for the reply. I looked back through the methods for strings. I also
> looked at the csv module, but I couldn't tell which one of those would help.
> The small .txt file does have commas, but with the weird form of listname =
> [1] , [2], [3], etc. for a .csv, I don't know how that would be read in a
> like a .csv. But now that I think about it, datObj2 in my script prints just
> the list elements, so maybe the 'listname=' part wouldn't affect it...
>

Hmm, interesting. Perhaps ast.literal_eval will help here? Parse off
the bit after the first equals sign and feed it to literal_eval.
You'll get back a tuple.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to