obviously first 6 chars are
replace
EXISTS
, so how you expect it to be int?replace
data= s.recv(1024) if data[:6] == 'EXISTS': filesize = int(data[:6])with
data= s.recv(1024) data = data.decode() if data.startswith('EXISTS'): filesize = int(data[6:])or
data= s.recv(1024) if data.startswith(b'EXISTS'): filesize = int(data[6:])
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs