Python Crytographic Toolkit, AES and OpenPGP

2006-10-24 Thread ml1n
Hello, Does anybody have an example of using Crypto.Cipher.AES to encrypt an OpenPGP literal data packet? I can't get MODE_PGP to work at all (gpg doesn't recognise the unencrypted packet), with MODE_CFB gpg correctly identifies the packet after decryption but it's body is incorrect (suggesting th

Re: Map with an extra parameter

2006-09-08 Thread ml1n
[EMAIL PROTECTED] wrote: > ml1n wrote: > > In the interests of speed my thinking was that using map would move the > > loop out of Python and into C, is that the case when using list > > comprehension? I'd always thought it was just syntatic short hand for > >

Re: Map with an extra parameter

2006-09-08 Thread ml1n
[EMAIL PROTECTED] wrote: > This may be what you need: > > class foo: > def __init__(self, a, b): > self.a = a > self.b = b > > vars = [1,2,3,4,5,6] > objects = [foo(a, 1) for a in vars] > > > Note that in Python the new is expressed wit the () at the end: > > > f = new foo() > > Bye,

Map with an extra parameter

2006-09-08 Thread ml1n
Hi, I'm not really sure how to explain this so maybe some example code is best. This code makes a list of objects by taking a list of ints and combining them with a constant: class foo: def __init__(self): self.a = 0 self.b = 0 def func(a,b): f = new foo() f.a = a f.b = b ret