In <[EMAIL PROTECTED]>, Hitesh wrote:

> That works for a string.
> But I am getting list of tuples from DB.
> 
> rows = [('\\serverName\C:\FolderName1\FolderName2\example.exe',),
> ('\\serverName\C:\FolderName1\FolderName2\example2.exe',),
> ('\\serverName\C:\FolderName1\FolderName2\example3.exe',),
> ('\\serverName\C:\FolderName1\FolderName2\example4.exe',)]
> 
> I tried this:
> for i in rows:
>     row = str(i)
>     path = row.replace("C:" , "c$")
>     print path
> 
> I am getting path something like
> 
> ('\\serverName\c$:\FolderName1\FolderName2\example.exe',)
> 
> How on the earth I can remove those paranthesis?

Well, don't convert the tuple to a string but get the string out of the
tuple instead.

for row in rows:
    path = row[0].replace('C:', 'C$')
    print path

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to