PKCS7 padding implementation in Python

2006-07-10 Thread Satchidanand Haridas
Hi,Do any of the cryptographic modules for Python support PKCS7 padding scheme? I would like to use this scheme with block cipher encryption algorithms to pad text whose length is less than a proper block size.  thanks in advance,Satchit -- http://mail.python.org/mailman/listinfo/python-list

WS-Security support for Python SOAP libraries

2006-06-14 Thread Satchidanand Haridas
Hi, Do any of the existing SOAP libraries for Python have support for WS-Security? thanks, Satchit -- http://mail.python.org/mailman/listinfo/python-list

creating single-instance executables using python/py2exe

2005-11-11 Thread Satchidanand Haridas
different files. Is there a way in which I can make sure only one instance is created? Any additional files are opened in the same running instance? Would appreciate any comments/feedback. thanks, Satchit -- Satchidanand Haridas (sharidas at zeomega dot com) ZeOmega (www.zeomega.com) Open

Re: best Pythonic way to do this sort: Python newb

2005-10-09 Thread Satchidanand Haridas
Satchidanand Haridas (sharidas at zeomega dot com) ZeOmega (www.zeomega.com) Open Minds' Open Solutions Sean Berry wrote: Paul Rubin http://[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sean Berry [EMAIL PROTECTED] writes: myList = [[value1, value2, value3

Re: Confused with module and .py files

2005-10-05 Thread Satchidanand Haridas
a class with the same name in two different modules, the better thing then (as others on the list have already pointed out) is to do the following: import import1, import2 c1 = import1.MyClass() c2 = import2.MyClass() regards, Satchit Satchidanand Haridas (sharidas at zeomega dot com

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Satchidanand Haridas
One possible solution. Don't know how efficient it is though. :-) def put_decimal(s): ... return ''.join( [ [s[i], '.%s' % s[i]][(len(s)-i)%3 == 0] for i in range(0, len(s))]) ... put_decimal(10001234) '10.001.234' put_decimal(12622) '12.622' thanks, Satchit [EMAIL PROTECTED] wrote:

Re: Removing dictionary-keys not in a set?

2005-04-18 Thread Satchidanand Haridas
Hi, I am not sure if this way is a good one, but it certainly is consise. Also sometimes, it's better to go for a simple approach than the consise one (for readability). With the abive disclaimer, I present my solution: d1 = {1 : 2, 3 : 4, 5 : 6, 7 : 8, 9 : 10 } s1 = [ 1, 5, 7 ] # assuming you

Re: A ClientForm Question

2005-04-06 Thread Satchidanand Haridas
Hi, ClientForm and Mechanize like tools do not execute javascript . You will normally have to do them manually in your python code itself. In your case, if you have a button, which (and I assume) executes some javascript code that sets some hidden variable and/or changes the 'action' attribute

Re: dictionary: sorting the values preserving the order

2005-04-01 Thread Satchidanand Haridas
Rakesh wrote: Hi, For a particular problem of mine, I want to sort key, value pairs by its value. Eg: Input: A, 4 B, 5 C, 1 D, 2 E, 3 I would like the output to be: C D E A B the following code does that: d1 = {'a':4,'b':5,'c':1,'d':2,'e':3} i1 = [ (d1[i], i) for i in d1.keys() ] i1.sort()

Re: tree data structure

2005-03-25 Thread Satchidanand Haridas
', { 'e' : 'f' }, {f : ( 'h', 'i', 'j' )} ) }, 'c' ) } hope this helps. regards, Satchit Satchidanand Haridas (sharidas at zeomega dot com) ZeOmega

Re: renaming 'references' to functions can give recursive problems

2005-02-16 Thread Satchidanand Haridas
peter wrote: Hello, nice solution: but it puzzles me :) can anyone tell me why ---correct solution def fA(input): return input def newFA(input, f= fA): return f(input) fA = newFA is correct and: def fA(input): ... print inside fA ... return input ... def

implementing singleton class at the module level

2005-02-10 Thread Satchidanand Haridas
Hi, I was looking at ways to implement a Singleton class. I saw some methods described on the PythonSingleton wiki (http://c2.com/cgi/wiki?PythonSingleton). I implemented the following. code module: A.py -- class Singleton: def __init__(self): #do something

Re: EDI x12 -- XML

2005-02-04 Thread Satchidanand Haridas
in the conversion of a X12 transaction to back-end database process. It can convert to and from an XML representation of the X12 document. fyi. thanks, Satchit Satchidanand Haridas (sharidas at zeomega dot com) ZeOmega (www.zeomega.com) Open Minds' Open Solutions #20,Rajalakshmi Plaza, South End Road

Re: Please suggest on the book to follow

2005-01-27 Thread Satchidanand Haridas
book for experienced programmers. 3. http://gnosis.cx/TPiP/ -- Site for Text Processing in Python, a book by David mertz. You will find many other very good Python related material on his website. regards, Satchit Satchidanand Haridas (sharidas at zeomega dot com) ZeOmega

Re: DevX: Processing EDI Documents into XML with Python

2005-01-25 Thread Satchidanand Haridas
There has already been some work in this area - although for X12 transactions for the healthcare industry. Its on sourceforge already and best of all the development language is Python: http://sourceforge.net/projects/pyx12/ thanks, Satchit Satchidanand Haridas (sharidas at zeomega dot com

Re: How can I get the names of the files in a directory?

2005-01-15 Thread Satchidanand Haridas
Hi, try the 'listdir' function in the 'os' module. Also check the 'walk' function. regards, Satchit Satchidanand Haridas (sharidas at zeomega dot com) ZeOmega (www.zeomega.com) Open Minds' Open Solutions #20,Rajalakshmi Plaza, South End Road, Basavanagudi, Bangalore-560 004, India Sara