Skip to main content

Convert String To Byte Array in Python

Convert String To Byte Array in Python

In this post, We will learn how to convert a string into a byte array in python programming language.

 def string_to_byte_array(string):  
      byteArray = []  
      for c in string:  
           byteArray = byteArray.append(ascii(c))  
 print (string_to_byte_array("Rozgardesh"))  

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

  1. Such a great article which i read before, it's a valuable suggestion to do in the process we can do.
    SEO training in chennai
    SEO course in chennai
    Digital marketing training in chennai

    ReplyDelete
  2. Nice to read the article which you posted lastly, its helpful to enhance my knowledge as well as for my career
    SEO training in velachery
    SEO training in anna nagar
    SEO course in chennai
    SEO training in porur
    SEO training in tambaram

    ReplyDelete
  3. Thanks for sharing the view from which i gather knowledge about the related topic. Your way of writing is easy to understand and expecting your next post
    Blue Prism training in chennai
    Blue Prism Training in Anna nagar
    RPA Training in Anna nagar
    Blue prism training chennai
    Data Science course in Anna nagar
    RPA Training in adyar

    ReplyDelete

Post a Comment