base64 module

Peter van Kampen news at datatailors.xs4all.nl
Fri Aug 8 17:05:40 EDT 2003


In article <RQSYa.177$XT6.62149 at news.uswest.net>, Ken Fettig wrote:
> Hello, I am trying to make use of the base64 module but am having problems.
> 
>>>> import base64
>>>> decodestring('SVNBKjAwKiAgICAgICAgICAqMDAqICAgICAg')
> Traceback (most recent call last):
>   File "<pyshell#1>", line 1, in ?
>     decodestring('SVNBKjAwKiAgICAgICAgICAqMDAqICAgICAg')
> NameError: name 'decodestring' is not defined
>>>>
> 
> What am I doing wrong. I am importing the base64 module, why can't I call
> the decodestring method?

Scope and Namespaces. Try:

>>> base64.decodestring('SVNBKjAwKiAgICAgICAgICAqMDAqICAgICAg')
'ISA*00*          *00*      '

See http://www.python.org/doc/current/tut/node11.html

Hth,

PterK

-- 
Peter van Kampen
pterk -- at -- datatailors.com




More information about the Python-list mailing list