from urllib.parse import urlencode
import quopri
# Туда
args = {'a':1, 'en': 'hello', 'rus': u'привет'}
url = urlencode(args, encoding='utf-8')
print(url)
# а теперь обратно
q = '%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82'
q = bytes(q.replace('%', '='), 'UTF-8')
print(q)
b = quopri.decodestring(q)
print(b.decode('UTF-8'))
In [1]: ', '.join(['my', 'super', 'list'])
Out[1]: 'my, super, list'
In [2]: import os
In [3]: os.path.join('path', 'to', 'script')
Out[3]: 'path/to/script'
In [4]: os.path.abspath(os.path.join('path', 'to', 'script'))
Out[4]: '/home/username/path/to/script'
In [5]: os.path.abspath(os.path.join('/', 'path', 'to', 'script'))
Out[5]: '/path/to/script'
for item in your_list:
print(item['id'], item['username'])
print('\n'.join('%s %s' % (item['id'], item['username']) for item in your_list))