call of non-function (type string) error

Graham Guttocks graham_guttocks at yahoo.co.nz
Tue Apr 10 20:23:03 EDT 2001


Greetings,

Any suggestions on how to get around this problem?  I'm trying to call
a function using variables, but it obviously doesn't work that way.

-----------------------------------------------

CIPHER = "DES3"
exec "from Crypto.Cipher import %s" % CIPHER

# cipherobj = DES3.new(KEY, DES3.CBC, IV)
cipherobj = CIPHER + 'new'(KEY,CIPHER + '.CBC',IV)

-----------------------------------------------


Traceback (most recent call last):
  File "<stdin>", line 10, in ?
TypeError: call of non-function (type string)



_____________________________________________________________________________
http://movies.yahoo.com.au - Yahoo! Movies
- Now showing: Dude Where's My Car, The Wedding Planner, Traffic..




More information about the Python-list mailing list