Add Quotes in url string from file


Question

I need script to add quotes in url string from url.txt

from http://www.site.com/info.xx to "http://www.site.com/info.xx"

1
2
4/23/2009 10:57:11 AM

url = '"%s"' % url

Example:

line = 'http://www.site.com/info.xx  \n'
url = '"%s"' % line.strip()
print url # "http://www.site.com/info.xx"

Remember, adding a backslash before a quotation mark will escape it and therefore won't end the string.

7
2/12/2009 9:47:32 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon