convert a long string in binary

bussiere maillist bussieremaillist at gmail.com
Sun Aug 20 07:35:36 EDT 2006


i've got a very long string
and i wanted to convert it in binary
like

string = """Monty Python, or The Pythons, is the collective name of
the creators of Monty Python's Flying Circus, a British television
comedy sketch show that first aired on the BBC on October 5, 1969. A
total of 45 episodes were made over four series. However, the Python
phenomenon was much greater, spawning stage tours, a musical, four
films, numerous albums, and several books, as well as launching the
members to individual stardom.

The television series, broadcast by the BBC from 1969 to 1974, was
conceived, written and performed by Graham Chapman, John Cleese
(1969-1973), Terry Gilliam, Eric Idle, Terry Jones and Michael Palin.
Loosely structured as a sketch show, but with a highly innovative
stream-of-consciousness approach (aided by Terry Gilliam's
animations), it pushed the boundaries of what was then considered
acceptable, both in terms of style and content.
"""

string = binary(string)
print string
// 01010101010101


i 'am searching for something like the binary function (taht doesn't
exist) to convert my string directly in binary.

Regards
Bussiere



More information about the Python-list mailing list