@R2kip

Откуда «» и почему \n не переносит строку?

import requests
def pb(text): 
    print(' \n '.join(text))
    url = requests.post('https://paste.mineland.me/documents', json=' \n'.join(text))
    id = url.text.replace('{"key":"','')
    id = id.replace('"}','')
    return 'https://paste.mineland.me/' + id,

text = ['[creative-shard-excellent-6][24.03 02:36:18] quit from server creative-shard-excellent-6', '[hub-main-6][24.03 02:36:18] joined server hub-main-6']
print(pb(text))


По идеи на сайте должно быть так
https://paste.mineland.me/kejenayixi
но выходит так
https://paste.mineland.me/axonuticit

Откуда "" и почему \n не переносит строку?
  • Вопрос задан
  • 155 просмотров
Решения вопроса 1
lxstvayne
@lxstvayne
Люблю Python
Вместо json, надо передавать data.
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
@PavelMos
В чём запускается ? В pycharm всё переносится
print(pb(text))
[creative-shard-excellent-6][24.03 02:36:18] quit from server creative-shard-excellent-6 
 [hub-main-6][24.03 02:36:18] joined server hub-main-6
('https://paste.mineland.me/upicigolen',)
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы