Python - string to omit the single quotes (')
After I assign a string to a variable, I know that the print function will remove the single quotes around the value, but is there a way to assign a variable without the quotes around the value?
for example:
a = open('/usr/lib', 'r+')
b = f.read()
c = x.replace('.xx','yy')
d = ?
c returns the value with quotes around it
print c returns the value without the quotes
Is there a way to assign a new variable (d) which will equal c without the quotes? I need a new variable which has the quotes omitted because from there the script will take the value of the last variable (which is a path to a file), and tar up that file. It won't recognize the path to the file if the value has quotes around it.
If not, what's an alternative?
Last edited by linuxuser111; 03-18-2011 at 06:20 PM.
|