I have a field on my web application that requires a KB. This is then reflected in the URL of the web app in Bytes form.
Can I convert a string of "500" KB to a string of Bytes in Python (expecting to get around "500000")?
From Wikipedia:
The kilobyte is a multiple of the unit byte for digital information. The International System of Units (SI) defines the prefix kilo as 1000 (103); therefore one kilobyte is 1000 bytes.
You can simply cast it to an integer,multiply it by 1000, and return it to a string like this:
>>> size_in_kb = "500"
>>> bytes = str(int(size_in_kb) * 1000)
>>> bytes
'500000'
Note: you can multiply it with 1024 instead of 1000, depends on your exact needs