I have a function that returns a value to me as a string. This is not an ascii representation of the value, it is the actual value, but the function returns it as a string type, while I need to treat it as an int. I am not allowed to change the function that I just have to extract from this.
in C, I would just apply it to an int pointer and resolve it as such:
myInt = *((int*)some_str_ptr)
how can i do this in python?
Again, I do not want to modify or convert the data into memory, I just want to process it and show it as an int.
update: Ive found that ord () does what I want on 1 char, but is there a built-in method to execute the whole line?
source
share