A problem with list

Batista, Facundo FBatista at uniFON.com.ar
Mon Dec 13 16:12:35 CET 2004


[export at hope.cz]

#- where my MyFile.txt looks like this:
#- ['abc','def']

The issue is that in the file you don't have a list, you have text, and
there is the difference in the behaviour.

>>> l = ['abc','def']
>>> for x in l:
	print x

abc
def
>>> s = "['abc','def']"
>>> for x in s:
	print x
	
[
'
a
b
c
'
,
'
d
e
f
'
]
>>> 

.	Facundo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20041213/de55d3ea/attachment.html>


More information about the Python-list mailing list