![]() ![]() Example 1 : In this example we can see that by using base64.encodestring (s) method, we are able to get the encoded string which can be in binary form by using this method. If no encoding is specified, UTF-8 will be used. Syntax : base64.encodestring (string) Return : Return the encoded string. Python 3 comes with a base64 module that allows developers to quickly and effortlessly encode and decode a string to its equivalent base64 format. Optional altchars must be a string of at least length 2 (additional characters are ignored) which specifies an alternative alphabet. In an earlier entry I mentioned that I was building a little app to display a bunch of static information. Python Dictionaries Access Items Change Items Add Items Remove Items Loop Dictionaries Copy Dictionaries Nested Dictionaries Dictionary Methods Dictionary Exercise Python If.Else Python While Loops Python For Loops Python Functions Python Lambda Python Arrays Python Classes/Objects Python Inheritance Python Iterators Python Scope Python Modules Python Dates Python Math Python JSON Python RegEx Python PIP Python Try. Python String encode () Method String Methods Example Get your own Python Server UTF-8 encode the string: txt 'My name is Stle' x txt.encode () print(x) Run example Definition and Usage The encode () method encodes the string, using the specified encoding. Base64 encoding image files using Python.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |