A
A
arynyklas2019-10-28 15:30:24
Layout
arynyklas, 2019-10-28 15:30:24

How to remove \n and b on the sides with requests.get(url)?

In my case, it's 2.4.6, but when I get it from the site, it returns b'2.4.6\n'
How can I remove \n and b?
Code like this:

if str(version_now) < str(version_git):
    version_now_1.truncate()
    version_now_1.seek(0)
    version_now_1.write(str(version_git.decode()))
    print("Обновлено!")

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-09-03
@greenfox07

List, horizontal positioning of its elements, green border. There are 4 lines inside, on the second in the center a green circle (border-radius: 50%; border-color: green;) with a "check" icon, on the background - a gray line (you can just use a piece of a picture)
What exactly causes difficulties for you? Or do you expect someone to make up for you?

M
Max, 2019-10-28
@arynyklas

response.text.strip()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question