i've tried to implement an auto update check into my Python programm. I want to achieve this by reading the content of a TXT file i hosted on my website (containing just "1.0" ) and checking it with a local variable.
So far i actually got everything working fine. however when i run the script, this is what it reads from the TXT file online
b'1.0'
This is the code i try to achieve this with
import urllib.request
import urllib
CurrentGameVersion = "1.0"
def updateGame():
with urllib.request.urlopen('http://myWebsite.de/version.txt') as response:
version = response.read()
if version != CurrentGameVersion:
print ("Update pls")
print (version)
print (CurrentGameVersion)
else:
print ("Up to Date!")
As i said, print (version) prints out b'1.0' while print (CurrentGameVersion) obviously prints out 1.0