Найти - Пользователи
Полная версия: Вывести список в колонку
Начало » Python для новичков » Вывести список в колонку
1
Antonpython
Добрый день, всем!
Подскажите, пожалуйста, как вывести строку в колонку? Потому что когда запускаю, в консоль выводит в длинную строку…неудобно читать…

 import requests
req = requests.get('http://www.tutsplus.com/')
print(req.headers)
scidam
 for name, value in req.headers.items():
    print(name, ': ', value)
py.user.next
  
>>> import requests
>>> import pprint
>>> 
>>> req = requests.get('https://www.yandex.ru')
>>> pprint.pprint(dict(req.headers))
{'Cache-Control': 'no-cache,no-store,max-age=0,must-revalidate',
 'Content-Encoding': 'gzip',
 'Content-Security-Policy': "connect-src 'self' wss://webasr.yandex.net "
                            'https://mc.webvisor.com https://mc.webvisor.org '
                            'wss://push.yandex.ru wss://portal-xiva.yandex.net '
                            'https://yastatic.net https://home.yastatic.net '
...
Antonpython
Спасибо!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB