Best practice prompting for password

2007-09-07 Thread GiBo
layed regardless if the output is redirected to a file or not. Any pointers to best practice or code snippet of python password prompt? Thanks Gibo -- http://mail.python.org/mailman/listinfo/python-list

Re: guess file type in python

2007-02-21 Thread GiBo
uot; tool uses libmagic.so library which in turn uses /etc/magic file with file format descriptions. To get some reliable results you'll have to call libmagic. The "file-4.xx.tar.gz" source tarball has python bindings included and there's a python-magic package (at least in

Which Crypto Library?

2007-02-21 Thread GiBo
o? For now I need a simple AES, no asymmetric crypto or GPG involved. Thanks! GiBo -- http://mail.python.org/mailman/listinfo/python-list

Re: New-style classes (was Re: Checking for EOF in stream)

2007-02-19 Thread GiBo
Gabriel Genellina wrote: > En Mon, 19 Feb 2007 22:30:59 -0300, GiBo <[EMAIL PROTECTED]> escribió: > >> Is there a reason why some classes distributed with Python 2.5 are not >> new-style classes? For instance StringIO is apparently "old-style" class >>

Re: Checking for EOF in stream

2007-02-19 Thread GiBo
Grant Edwards wrote: > On 2007-02-19, GiBo <[EMAIL PROTECTED]> wrote: >> Hi! >> >> Classic situation - I have to process an input stream of unknown length >> until a I reach its end (EOF, End Of File). How do I check for EOF? The >> input stream can be anyt

New-style classes (was Re: Checking for EOF in stream)

2007-02-19 Thread GiBo
GiBo wrote: > Hi! > > Classic situation - I have to process an input stream of unknown length > until a I reach its end (EOF, End Of File). How do I check for EOF? > [...] > I'd better like something like: > > while not stream.eof(): > ... Is there a rea

Checking for EOF in stream

2007-02-19 Thread GiBo
as I know e.g. network sockets streams may return less data than requested even when the socket is still open. I'd better like something like: while not stream.eof(): ... but there is not eof() method :-( This is probably a trivial problem but I haven't found a decent sol

Re: How to instantiate a different class in a constructor?

2007-01-23 Thread GiBo
Paul McGuire wrote: > On Jan 23, 5:09 am, GiBo <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I have a class URI and a bunch of derived sub-classes for example >> HttpURI, FtpURI, HttpsURI, etc. (this is an example, I know there is >> module urllib & frie

How to instantiate a different class in a constructor?

2007-01-23 Thread GiBo
", line 7, in __new__ instance = object.__new__(subclass, arg) TypeError: default __new__ takes no parameters - Does anyone have any hints on how to solve this problem? (other than using urllib or other standard modules - as I said this is just to demonstrate the nature of my problem). Thanks! GiBo -- http://mail.python.org/mailman/listinfo/python-list