List comprehension is currently the Pythonic method for this:
q = [ 'with space1', 'with space2' ]
qescaped = [ urllib.quote(u) for u in q ]
Often you do not even need to create this list, but you can use the generator itself instead:
qescapedGenerator = (urllib.quote(u) for u in q)
(This saves memory and, if you do not need all the elements, also computation time.)
Many generators can also process generators:
urlsInLines = '\n'.join(urllib.quote(u) for u in q)
for escapedUrl in (urllib.quote(u) for u in q):
print escapedUrl
- , list() .