I need to extract the bytes from a string variable in Python (v 2.6) to pass it as a parameter for another function which expects a byte array.
Here is an example of what I have:
myStr = "some string"
What I need is something equivalent of a byte array but from the myStr variable.:
bytes = b'some string'
I tried using myStr.encode(), but I received a TypeError from the target function.
Any help is much appreciated.