removing the single quote from a list of

Posted by tanky on Stack Overflow See other posts from Stack Overflow or by tanky
Published on 2012-09-26T14:56:26Z Indexed on 2012/09/26 15:37 UTC
Read the original article Hit count: 195

Filed under:
|

I need to append/format a url with a list of ids for an api call

however, when i put the list at the end of the api

https://api.twitter.com/1.1/users/lookup.json?user_id=%s'%a

i just get an empty string as a response.

i have tried turning the list into a string and removing the square brackets doing

a = str(followers['ids'])[1:-1]

but i still get the same problem. and im assuming that its being caused by the single quote at the start.

i have tried removing the apostrophe from the string doing

a.replace("'", "")

and now i have run out of ideas

thanks

© Stack Overflow or respective owner

Related posts about python

Related posts about api