Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > base64 module

Reply
Thread Tools

base64 module

 
 
Ken Fettig
Guest
Posts: n/a
 
      08-08-2003
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?


 
Reply With Quote
 
 
 
 
Peter van Kampen
Guest
Posts: n/a
 
      08-08-2003
In article <RQSYa.177$>, 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('SVNBKjAwKiAgICAgICAgICAqMDAqI CAgICAg')

'ISA*00* *00* '

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

Hth,

PterK

--
Peter van Kampen
pterk -- at -- datatailors.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using methods base64 module in conjunction with Crypto.Hash.SHA256 mirandacascade@yahoo.com Python 1 12-20-2006 08:53 PM
Re: module docstring, documentation,anything? please note is the module type/object NOT some module Maric Michaud Python 0 06-24-2006 12:42 PM
ASP.NET + C# + TabletPC ActiveX Control + JavaScript = Base64 to GIF Kunal ASP .Net 0 10-02-2003 11:23 PM
base64.rb - wrap in a module? Daniel Berger Ruby 0 07-31-2003 07:59 AM
base64 enc/dec problem PCH ASP .Net 2 07-01-2003 06:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57