So I have a list like this:
['a', 'b', 'c', 'd', 'e' ]
I have converted this list into a string:
"'a', 'b', 'c', 'd', 'e'"
The double inverted comma around the string only exists to wrap around the single inverted comma- I need the single inverted commas. The issue is when I input this string to a package that only takes this:
'a', 'b', 'c', 'd', 'e'
Of course, there is an error. Now, I have tried .replace(' " ' , ' ')
, string slicing, and all others mentioned here. Nothing works as the double quotation is not part of the string but only exists to print it and is carried to the variable during the assignment.
EDIT:
Here is part of how I converted the list to string:
string=''
# ...
string = string + (" '%s '," %(items) )
EDIT to add more information because of the following comment:
I am playing with this tool. In the following example all I am saying is that I am auto generating some variable to put in the third line but whatever I do, it invariably puts an additional comma around the string:
from dd import autoref as _bdd
bdd = _bdd.BDD()
bdd.declare('x', 'y', 'z') # ----------------------<this line>
u = bdd.add_expr('(x /\ y) \/ ~ z')
bdd.collect_garbage() # optional
bdd.dump('awesome.pdf')
The error I get is:
AssertionError: undefined variable "a", known variables are:
{"'x', 'y', 'z'": 0}
You will be able to generate this error if you simply replace the third line with this:
bdd.declare("'x', 'y', 'z'")