Convert string to bytes object python

Python -- Posted on Oct. 14, 2018

Convert string to bytes object python

              
                my_simple_string = 'test'
bytes_obj = bytes(my_simple_string, 'utf-8')
print(bytes_obj)
                  
   
            

Related Posts