[Tutor] convert ascii to binary
joel.goldstick at gmail.com
Wed Sep 12 13:54:05 CEST 2012
On Wed, Sep 12, 2012 at 7:20 AM, Aaron Pilgrim <aaronpil at gmail.com> wrote:
> I am trying to write a small program that converts ascii to binary.
> I tried using the python reference library section 18.8 but had
> trouble understanding how to make it work.
> Here is the code I am currently trying to use:
> def main():
> import binascii
> myWord = input("Enter the word to convert..")
> #convert text to ascii
> for ch in myWord:
> #convert ascii to binary
A couple of thoughts. The section you reference suggests using higher
level modules such as uu.
uu seems to want to read an ascii file and write a uu encoded file.
I just read the wikipedia article on uuencoding, since I have heard of
it, but never needed to know about it. It is apparently a pretty old
method of transforming 3 consecutive 8 bit ascii characters into 4 6
bit uuencoded characters so that they can be sent between (unix)
What are you really trying to do? Is this for experimenting with
python? or are you trying to solve some larger problem?
More information about the Tutor