[Tutor] Please help me

David Porter jcm@bigskytel.com
Sat, 10 Jun 2000 01:04:19 -0600

* Hoang The Anh <theanh@webteam.vnn.vn>:

> Now, I can't encode string by using base64 modulle. I want cat (used
> Unix command) one file then encode this string) .
> Could you give me one example to carry out this case.

If I understand what you want, you do not need to use cat:

import base64

text = open('a_file').read()
encoded_text = base64.encodestring(text)
print encoded_text

> Thank for you help!!!!!!!!!!!!!


Foreword from is either complicated. -- e.e.cummings in a blender