I have a variable which is in bytes for example:
k=b'gAAAAABfGakqAaKNJwYTmdsERYzv9_o9rAOpwPjRSGYxBIRKHYfUgh7CtMrZpJMrxkH8bc0dami_D2tOO8EOHNZkZiHWZUTvmw=='
<class 'bytes'> now if I convert this to string using str(k) value of k:
b'gAAAAABfGakqAaKNJwYTmdsERYzv9_o9rAOpwPjRSGYxBIRKHYfUgh7CtMrZpJMrxkH8bc0dami_D2tOO8EOHNZkZiHWZUTvmw=='
<class 'str'>
Now if i need the original byte version of the variable how do i convert it? Because if I use bytes(k,'encoding') i get the bytes version of the new string and the value changes to
b"b'gAAAAABfGawb3lL2uGxUSlKw4ujOts_7TMGtXBlbDddhBZ_0VgHylkpbrKtFqtU0CDz4gaenzDIuNTd3zM9ydksOnd6nQaz9Sw=='"
<class 'bytes'> Can someone tell me how can I get back the original data type from the string value of the variable?