Re: backslashes in lists

2007-03-12 Thread Lucas Torri
hehe, só vendo o ['Arquivo de configuracao da arquitetura'] da pra ver que é brasileiro =) I didn't undestand, what didn't worked? I've tryied this, and all went ok: list1 = ['name', 'value'] list2 = ['path', 'c:\some\path'] list3 = [list1, list2] print str(list3).replace('','\\') [['nam

Re: backslashes in lists

2007-03-12 Thread Lucas Torri
just like the same way, but replace alist -> list: str(list).replace('','\\') as the time you call str(object) you will have an object of type string, and you can do whatever you want/could do with it... what are you trying?! isn't more interesting use a hash table? On 3/12/07, Fabio Gom

Re: backslashes in lists

2007-03-12 Thread Lucas Torri
I don't know how ugly this look like, but { print str(alist).replace('', '\\') } works... On 3/12/07, Fabio Gomes <[EMAIL PROTECTED]> wrote: Yes, Luca. I noticed that printing the list item will show the string as expected. But I need to print the entire list in the script I'm writing a

Re: backslashes in lists

2007-03-12 Thread Lucas Torri
The backslash is a key to enter especial characters, like breakline: '\n' There is two backslashes cause of this especial condition of this char, but if you try print the specific string you will see that only one backslash remain: print alist[2] On 3/12/07, Fabio Gomes <[EMAIL PROTECTED]> wrot

Re: New to Python

2007-03-12 Thread Lucas Torri
Something like that? z = tuple(map(lambda x,y: x+y, x, y)) On 3/11/07, Alberto Vieira Ferreira Monteiro <[EMAIL PROTECTED]> wrote: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 +