Dnia 19-08-2009 o 02:09:29 WilsonOfCanada <[email protected]> napisaĆ(a):
You're right, but the moment I append it onto a list, it would become
C:\\moo.
No, it would not. Really!
C:\moo
C:\supermoo
['C:\\moo', 'C:\\supermoo']
It is not the matter of content of the string but only of a way of
*presentation* of it by print:
print arrPlaces
in the example is roughly equivalent to:
print '[' + repr(a_list[0]) + ', ' + repr(a_list[1]) + ']'
So try:
print a_list[0]
Output:
C:\moo
print a_list[1]
Output:
C:\supermoo
print ', '.join(arrPlaces)
Output:
C:\moo, C:\supermoo
print ', '.join("'%s'" % item for item in arrPlaces)
Output:
'C:\moo', 'C:\supermoo'
Cheers,
*j
--
Jan Kaliszewski (zuo) <[email protected]>
--
http://mail.python.org/mailman/listinfo/python-list