Re: class viewer ?

2010-01-10 Thread Ben Finney
Stef Mientki writes: > from the given class, it's ancestors and it's derived classes, > I'ld like to get the following information in a tree like structure: > > - the file were the class is definied > - the attributes, split in inherited / created / overriden > - the methodes, split in inherited

Re: "Advanced" Python programming book?

2010-01-10 Thread Marco Salden
On Jan 10, 2:35 pm, flow wrote: > I've just finished reading a sort of beginner Python book, and I know > quite a bit now but I'm looking for a book that can teach me advanced > aspects of Python - code optimisation, threading, etc. > > Any recommendations? > > Cheers. I like to add this one, whi

Re: how to duplicate array entries

2010-01-10 Thread Steven D'Aprano
On Sun, 10 Jan 2010 22:21:54 -0800, Sebastian wrote: > Hi there, > > I have an array x=[1,2,3] You have a list. Python has an array type, but you have to "import array" to use it. > Is there an operator which I can use to get the result > [1,1,1,2,2,2,3,3,3] ? Not an operator, but you can d

Re: how to duplicate array entries

2010-01-10 Thread Gary Herron
Paul Rudin wrote: Sebastian writes: Hi there, I have an array x=[1,2,3] In python such an object is called a "list". (In cpython it's implemented as an automatically resizable array.) Is there an operator which I can use to get the result [1,1,1,2,2,2,3,3,3] ? There's

Re: integer and string compare, is that correct?

2010-01-10 Thread Dan Bishop
On Jan 10, 10:34 am, Nobody wrote: > Hellmut Weber wrote: > >> being a causal python user (who likes the language quite a lot) > >> it took me a while to realize the following: > >>  >>> max = '5' > >>  >>> n = 5 > >>  >>> n >= max > >> False > > >> Section 5.9 Comparison describes this. > > >> Ca

Re: how to duplicate array entries

2010-01-10 Thread Paul Rudin
Sebastian writes: > Hi there, > > I have an array x=[1,2,3] In python such an object is called a "list". (In cpython it's implemented as an automatically resizable array.) > > Is there an operator which I can use to get the result > [1,1,1,2,2,2,3,3,3] ? There's no operator that will give yo

Re: how to duplicate array entries

2010-01-10 Thread Chris Rebert
On Sun, Jan 10, 2010 at 10:21 PM, Sebastian wrote: > Hi there, > > I have an array  x=[1,2,3] > > Is there an operator which I can use to get the result > [1,1,1,2,2,2,3,3,3] ? > > I tried x*3, which resulted in [1,2,3,1,2,3,1,2,3] > I also tried [[b,b,b] for b in x] which led to [[1,2,3],[1,2,3],

Re: how to duplicate array entries

2010-01-10 Thread Sebastian
On Jan 11, 4:21 pm, Sebastian wrote: > I also tried [[b,b,b] for b in x] which led to [[1,2,3],[1,2,3], > [1,2,3]] Sorry, I have to correct myself. The quoted line above resulted in [[1,1,1],[2,2,2],[3,3,3]] of course! Cheers, Sebastian -- http://mail.python.org/mailman/listinfo/python-list

how to duplicate array entries

2010-01-10 Thread Sebastian
Hi there, I have an array x=[1,2,3] Is there an operator which I can use to get the result [1,1,1,2,2,2,3,3,3] ? I tried x*3, which resulted in [1,2,3,1,2,3,1,2,3] I also tried [[b,b,b] for b in x] which led to [[1,2,3],[1,2,3], [1,2,3]], but this isn't what I want either. Cheers, Sebastian --

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-10 Thread casevh
On Jan 10, 8:16 pm, Dave WB3DWE wrote: > On Sat, 9 Jan 2010 16:48:52 -0800 (PST), casevh > wrote: > > >On Jan 9, 3:10 pm, pdlem...@earthlink.net wrote: > >> On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh > >> wrote: > > >1) Try the commands again. Make sure all the "./configure" options are > >o

Re: lightweight encryption of text file

2010-01-10 Thread Steve Holden
Carl Banks wrote: > On Jan 8, 11:14 am, Daniel Fetchinson > wrote: >> I have a plain text file which I would like to protect in a very >> simple minded, yet for my purposes sufficient, way. I'd like to >> encrypt/convert it into a binary file in such a way that possession of >> a password allows a

Re: lightweight encryption of text file

2010-01-10 Thread geremy condra
On Sun, Jan 10, 2010 at 3:26 PM, Paul Rubin wrote: > geremy condra writes: >> Not sure why in the world you would homebrew something like this- a >> small dependency isn't that bad, and aes can be pretty simple to use. >> Might as well go for the industrial strength approach. > > In my experience

Re: lightweight encryption of text file

2010-01-10 Thread Carl Banks
On Jan 8, 11:14 am, Daniel Fetchinson wrote: > I have a plain text file which I would like to protect in a very > simple minded, yet for my purposes sufficient, way. I'd like to > encrypt/convert it into a binary file in such a way that possession of > a password allows anyone to convert it back i

Re: lightweight encryption of text file

2010-01-10 Thread Steve Holden
Paul Rubin wrote: > Steve Holden writes: >>> Right now, even asking for HTTPS support is too much to ask. Heck, >>> even asking for the fake HTTPS support to be identified as such is too >>> much, apparently. >>> >> No, Paul, nobody will complain if you *ask* ... > > Er, that wasn't me... > Oh s

Re: How to validate the __init__ parameters

2010-01-10 Thread Aahz
In article , Jean-Michel Pichavant wrote: > >class A: >def __init__(self, foo = None, bar = None): >if len(foo) > 5: > raise ValueError('foo cannot exceed 5 characters') Bad Idea -- what happens when foo is None? -- Aahz (a...@pythoncraft.com) <*> htt

Re: py2exe "for loop" hangs in compiled program

2010-01-10 Thread Aahz
In article , p_tierchen <1...@sms.at> wrote: > >the application is an interface to a sqlite database and stores image >metadata (such as year, event, photographer, people on image etc.). i >use pyqt4 for the interface and developed this application on a linux >platform (python 2.5.4). friends of m

Re: lightweight encryption of text file

2010-01-10 Thread Paul Rubin
Nobody writes: > But, yeah, the OP needs to be aware of the difference (and probably isn't, > yet). So to take that a step further ... > The key passed to arcfour.schedule() shouldn't be re-used > If you need to verify the data, append a hash of the ciphertext ... > If you want to encrypt mul

Re: lightweight encryption of text file

2010-01-10 Thread Paul Rubin
Steve Holden writes: >> Right now, even asking for HTTPS support is too much to ask. Heck, >> even asking for the fake HTTPS support to be identified as such is too >> much, apparently. >> > No, Paul, nobody will complain if you *ask* ... Er, that wasn't me... > A question I've been asking myse

Re: Fractional Hours from datetime?

2010-01-10 Thread Austyn
Here's an improvement in case you want your code to work outside of Arizona: from time import time, timezone h = ((time() - timezone) / 3600) % 24 On Jan 10, 9:04 pm, Austyn wrote: > How about: > > import time > arizona_utc_offset = -7.00 > h = (time.time() / 3600 + arizona_utc_offset) % 24 > >

Re: interactive terminal in Ubuntu Linux : libreadline5-dev works only in Python 2.6 not 3.1

2010-01-10 Thread Dave WB3DWE
On Sat, 9 Jan 2010 16:48:52 -0800 (PST), casevh wrote: >On Jan 9, 3:10 pm, pdlem...@earthlink.net wrote: >> On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh >> wrote: > >1) Try the commands again. Make sure all the "./configure" options are >on one line. Make sure to do "sudo make altinstall". (D

Re: Fractional Hours from datetime?

2010-01-10 Thread Austyn
How about: import time arizona_utc_offset = -7.00 h = (time.time() / 3600 + arizona_utc_offset) % 24 dt.timetuple()[6] is the day of the week; struct tm_time doesn't include a sub-second field. On Jan 10, 10:28 am, "W. eWatson" wrote: > Maybe there's a more elegant way to do this. I want to exp

Re: lightweight encryption of text file

2010-01-10 Thread Steve Holden
Nobody wrote: > On Sun, 10 Jan 2010 12:26:05 -0800, Paul Rubin wrote: > >> I'd like it a lot if the Python stdlib could include a serious >> cryptography module. > > And I'd like a truckload of gold ;) > > Right now, even asking for HTTPS support is too much to ask. Heck, > even asking for the f

Re: lightweight encryption of text file

2010-01-10 Thread Nobody
On Sun, 10 Jan 2010 12:26:05 -0800, Paul Rubin wrote: > I'd like it a lot if the Python stdlib could include a serious > cryptography module. And I'd like a truckload of gold ;) Right now, even asking for HTTPS support is too much to ask. Heck, even asking for the fake HTTPS support to be identi

Re: lightweight encryption of text file

2010-01-10 Thread Nobody
On Sun, 10 Jan 2010 08:54:51 -0800, Paul Rubin wrote: > Nobody writes: >> RC4 (aka ArcFour) is quite trivial to implement, and better than inventing >> your own cipher or using a Vignere: ... > > That's a cute implementation, but it has no authentication and doesn't > include any randomness, whi

Re: Python Goldmine has been updated: http://preciseinfo.org/Convert/index_Convert_Python.html

2010-01-10 Thread Steve Holden
Steve Holden wrote: [...] > Because I habitually run the NoScript extension to Firefox the popups > didn't appear, but there didn't seem to be any original content on this > site. Google continues to be your friend. > And dammit, why didn't I think to strip the links out instead of creating yet on

Re: Python Goldmine has been updated: http://preciseinfo.org/Convert/index_Convert_Python.html

2010-01-10 Thread Steve Holden
Terry Reedy wrote: > On 1/8/2010 11:50 AM, tanix wrote: >> Python Goldmine collection contains the extensive collection of articles >> going back several years. It includes thousands of code >> examples and expert discussions on all major topics. >> >> The information is organized by relevant topic

Re: Python Goldmine has been updated: http://preciseinfo.org/Convert/index_Convert_Python.html

2010-01-10 Thread Terry Reedy
On 1/8/2010 11:50 AM, tanix wrote: Python Goldmine collection contains the extensive collection of articles going back several years. It includes thousands of code examples and expert discussions on all major topics. The information is organized by relevant topics, covered by the corresponding c

Re: Computer Music Toolkit (CMT) ?

2010-01-10 Thread Terry Reedy
On 1/10/2010 4:15 AM, Peter Billam wrote: Greetings. Is there a way to get at the Computer Music Toolkit (CMT) http://www.ladspa.org/cmt/ functionality from Python (Python3 in my case) ? You can access compiled C shared libraries most easily via the ctypes module. Searching Python CMT "Co

Re: Microsoft Office Word and Python (Win XP)

2010-01-10 Thread 3lvss0...@gmail.com
no idea :-( -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Office Word and Python (Win XP)

2010-01-10 Thread 3lvss0...@gmail.com
? -- http://mail.python.org/mailman/listinfo/python-list

Re: Manipulating pointers in C using ctypes

2010-01-10 Thread Daniel Platz
Thanks for valuable answers. Both solutions work and I understand my mistake. Best regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Introspection

2010-01-10 Thread m...@infoserv.dk
Thanks Miki and Jason. I knew it could be done :-) -- http://mail.python.org/mailman/listinfo/python-list

Python Goldmine has been updated: http://preciseinfo.org/Convert/index_Convert_Python.html

2010-01-10 Thread tanix
Python Goldmine collection contains the extensive collection of articles going back several years. It includes thousands of code examples and expert discussions on all major topics. The information is organized by relevant topics, covered by the corresponding chapters. The information was filtere

Fractional Hours from datetime?

2010-01-10 Thread W. eWatson
Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 # now is in fractions of an hour -- http://mail.pyth

Re: setTextAlignment function Qtablewidget PyQt

2010-01-10 Thread Zabin
On Jan 11, 1:10 pm, Zabin wrote: > Hey! > > I am trying to align contents of some table cells but find the code > below working for some fields and not for others. I am stuck as to why > this is happening. Help will be gretly appreciated! > > setTextAlignment(QtCore.Qt.AlignVCenter) > > Cheers > Z

sys.stdout vs. sys.stderr

2010-01-10 Thread Mitchell L Model
In Python 3.1 is there any difference in the buffering behavior of the initial sys.stdout and sys.stderr streams? They are both line_buffered and stdout doesn't seem to use a larger-grain buffering, so they seem to be identical with respect to buffering. Were they different at some earlier

setTextAlignment function Qtablewidget PyQt

2010-01-10 Thread Zabin
Hey! I am trying to align contents of some table cells but find the code below working for some fields and not for others. I am stuck as to why this is happening. Help will be gretly appreciated! setTextAlignment(QtCore.Qt.AlignVCenter) Cheers Zabin -- http://mail.python.org/mailman/listinfo/py

class viewer ?

2010-01-10 Thread Stef Mientki
hello, I'd like to have a class viewer, something different from pydoc, and I wonder if someone has made something similar. from the given class, it's ancestors and it's derived classes, I'ld like to get the following information in a tree like structure: - the file were the class is definied -

Re: getopt not raising exception

2010-01-10 Thread Emmanuel Surleau
> Matt Nordhoff wrote: > > BTW: Checked out optparse? It's bigger and sexier! If you're doing things with positional arguments, you should consider using argparse (http://argparse.googlecode.com/svn/tags/r101/doc/index.html). It's like optparse, but (much) better. Cheers, Emm -- http://mail.

Re: getopt not raising exception

2010-01-10 Thread Matthew Lear
Matt Nordhoff wrote: > BTW: Checked out optparse? It's bigger and sexier! Thanks for the tip. Works a treat. -- Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft Office Word and Python (Win XP)

2010-01-10 Thread 3lvss0...@gmail.com
so does anyone know how I could do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: lightweight encryption of text file

2010-01-10 Thread Paul Rubin
geremy condra writes: > Not sure why in the world you would homebrew something like this- a > small dependency isn't that bad, and aes can be pretty simple to use. > Might as well go for the industrial strength approach. In my experience, 1) small dependencies ARE that bad, since they mean you ha

How to use list type generated by SWIG?

2010-01-10 Thread Bryan
I am writing a small script to manage my ipod. I am using the python bindings for libgpod. I have never used swig, or used python to program against a c/c++ library. I can get the library to find my ipod, and parse its DB format, but I'm not sure how to interact with the types that some of the f

"Bad file descriptor" in HTTPServer using Multiprocessing.

2010-01-10 Thread Adam Tauno Williams
I have a Python multiprocessing application where a master process starts server sub-processes and communicates with them via Pipes; that works very well. But one of the subprocesses, in turn, starts a collection of HTTPServer 'workers' (almost exactly as demonstrated in the docs). This works pe

Re: Milliseconds in logging format

2010-01-10 Thread Irmen de Jong
On 10-1-2010 20:04, Joan Miller wrote: How the logging '%(asctime)s' [1] specifier to gets the millisecond portion of the time if there is not a directive to get it from the time module [2] ? "The date format string follows the requirements of strftime()" [1] http://docs.python.org/library/logg

Re: lightweight encryption of text file

2010-01-10 Thread geremy condra
Not sure why in the world you would homebrew something like this- a small dependency isn't that bad, and aes can be pretty simple to use. Might as well go for the industrial strength approach. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Academic Question

2010-01-10 Thread MRAB
Victor Subervi wrote: Hi; The following code that works: #! /usr/bin/python import string import cgitb; cgitb.enable() import cgi import MySQLdb import sys,os from sets import Set import fpformat cwd = os.getcwd() sys.path.append(cwd) from login import login from particulars import ourOptions

Milliseconds in logging format

2010-01-10 Thread Joan Miller
How the logging '%(asctime)s' [1] specifier to gets the millisecond portion of the time if there is not a directive to get it from the time module [2] ? "The date format string follows the requirements of strftime()" [1] http://docs.python.org/library/logging.html#basic-example [2] http://docs.p

Re: problem with cheetah

2010-01-10 Thread Aahz
In article <0fd84b05-cf12-485b-a14e-608e47679...@s20g2000yqd.googlegroups.com>, mlowicki wrote: > >Hi!, i get such error when I try to install cheetah: Probably better to ask on the Cheetah list: https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss -- Aahz (a...@pythoncraft.com

Re: integer and string compare, is that correct?

2010-01-10 Thread Peter Otten
Somebody wrote: > If you actually need to perform comparisons across types, you can rely > upon the fact that tuple comparisons are non-strict and use e.g.: > > > a = 5 > > b = '5' > > (type(a).__name__, a) < (type(b).__name__, b) > True > > (type(a).__name__, a) > (type(b).__name__, b) > False >

Re: Something More Elegant

2010-01-10 Thread Victor Subervi
On Sat, Jan 9, 2010 at 3:00 PM, Stephen Hansen wrote: > On Sat, Jan 9, 2010 at 7:15 AM, Victor Subervi wrote: > >> On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden wrote: >> >>> But we are now in the realm of theory as far as you are concerned, since >>> you have already stated several times that you

Academic Question

2010-01-10 Thread Victor Subervi
Hi; The following code that works: #! /usr/bin/python import string import cgitb; cgitb.enable() import cgi import MySQLdb import sys,os from sets import Set import fpformat cwd = os.getcwd() sys.path.append(cwd) from login import login from particulars import ourOptions form = cgi.FieldStorage(

Re: lightweight encryption of text file

2010-01-10 Thread Paul Rubin
Nobody writes: > RC4 (aka ArcFour) is quite trivial to implement, and better than inventing > your own cipher or using a Vignere: ... That's a cute implementation, but it has no authentication and doesn't include any randomness, which means if you use the same key for two inputs, there is a secur

Re: lightweight encryption of text file

2010-01-10 Thread Daniel Fetchinson
>> Thanks, this looks very simple too, but where is the decryption code? >> Wikipedia seems to suggest that encryption and decryption are both the >> same but running crypt on the output of crypt doesn't give back the >> original string. So probably I'm misunderstanding something. > > Yes, the natu

Re: "Advanced" Python programming book?

2010-01-10 Thread Tom Pacheco
Ryniek90 wrote: I've just finished reading a sort of beginner Python book, and I know quite a bit now but I'm looking for a book that can teach me advanced aspects of Python - code optimisation, threading, etc. Any recommendations? Cheers. Check those link: http://www.amazon.com/Beginni

Re: integer and string compare, is that correct?

2010-01-10 Thread Nobody
Hellmut Weber wrote: >> being a causal python user (who likes the language quite a lot) >> it took me a while to realize the following: >> >>> max = '5' >> >>> n = 5 >> >>> n >= max >> False > >> Section 5.9 Comparison describes this. >> >> Can someone give me examples of use cases Peter Ot

Re: lightweight encryption of text file

2010-01-10 Thread Nobody
On Sun, 10 Jan 2010 15:30:12 +, Steven D'Aprano wrote: >> Thanks, this looks very simple too, but where is the decryption code? >> Wikipedia seems to suggest that encryption and decryption are both the >> same but running crypt on the output of crypt doesn't give back the >> original string. S

Re: lightweight encryption of text file

2010-01-10 Thread Nobody
On Sun, 10 Jan 2010 09:59:31 +0100, Daniel Fetchinson wrote: > Thanks, this looks very simple too, but where is the decryption code? > Wikipedia seems to suggest that encryption and decryption are both the > same but running crypt on the output of crypt doesn't give back the > original string. So

[ANN] Spyder v1.0.2 released

2010-01-10 Thread Pierre Raybaut
Hi all, I'm pleased to announce here that Spyder version 1.0.2 has been released: http://packages.python.org/spyder Previously known as Pydee, Spyder (Scientific PYthon Development EnviRonment) is a free open-source Python development environment providing MATLAB-like features in a simple and li

Re: lightweight encryption of text file

2010-01-10 Thread Steven D'Aprano
On Sun, 10 Jan 2010 09:59:31 +0100, Daniel Fetchinson wrote: > Thanks, this looks very simple too, but where is the decryption code? > Wikipedia seems to suggest that encryption and decryption are both the > same but running crypt on the output of crypt doesn't give back the > original string. So

"Advanced" Python programming book?

2010-01-10 Thread Ryniek90
> I've just finished reading a sort of beginner Python book, and I know > quite a bit now but I'm looking for a book that can teach me advanced > aspects of Python - code optimisation, threading, etc. > > Any recommendations? > > Cheers. Check those link: http://www.amazon.com/Beginning-Python-V

Re: Prepend to logging message

2010-01-10 Thread Joan Miller
On 10 ene, 13:10, Joan Miller wrote: > On 10 ene, 12:36, Peter Otten <__pete...@web.de> wrote: > > > > > Joan Miller wrote: > > > On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote: > > >> Joan Miller wrote: > > >> > How to prepend anything to a logging message? Is possible to do it > > >> > f

"Advanced" Python programming book?

2010-01-10 Thread flow
I've just finished reading a sort of beginner Python book, and I know quite a bit now but I'm looking for a book that can teach me advanced aspects of Python - code optimisation, threading, etc. Any recommendations? Cheers. -- http://mail.python.org/mailman/listinfo/python-list

Re: integer and string compare, is that correct?

2010-01-10 Thread Peter Otten
Hellmut Weber wrote: > being a causal python user (who likes the language quite a lot) > it took me a while to realize the following: > > > l...@sylvester py_count $ python > Python 2.6.3 (r263:75183, Oct 26 2009, 12:34:23) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "licens

Re: Prepend to logging message

2010-01-10 Thread Joan Miller
On 10 ene, 12:36, Peter Otten <__pete...@web.de> wrote: > Joan Miller wrote: > > On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote: > >> Joan Miller wrote: > >> > How to prepend anything to a logging message? Is possible to do it > >> > from the dictionary object (ExtraLog) or is there is that

Re: integer and string compare, is that correct?

2010-01-10 Thread Chris Rebert
On Sun, Jan 10, 2010 at 4:46 AM, Chris Rebert wrote: > The behavior of disparate types being comparable is deprecated and has > been removed in Python 3.0+; don't rely upon it. Clarification: Equality testing between disparate types still works unaltered however. By "comparable", I meant >, <, >

Re: integer and string compare, is that correct?

2010-01-10 Thread Chris Rebert
On Sun, Jan 10, 2010 at 4:26 AM, Hellmut Weber wrote: > Hi, > being a causal python user (who likes the language quite a lot) > it took me a while to realize the following: > > > l...@sylvester py_count $ python > Python 2.6.3 (r263:75183, Oct 26 2009, 12:34:23) > [GCC 4.4.1] on linux2 > Type "hel

Re: Prepend to logging message

2010-01-10 Thread Peter Otten
Joan Miller wrote: > On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote: >> Joan Miller wrote: >> > How to prepend anything to a logging message? Is possible to do it >> > from the dictionary object (ExtraLog) or is there is that override >> > process() [1]? >> >> > -- >> > cla

integer and string compare, is that correct?

2010-01-10 Thread Hellmut Weber
Hi, being a causal python user (who likes the language quite a lot) it took me a while to realize the following: l...@sylvester py_count $ python Python 2.6.3 (r263:75183, Oct 26 2009, 12:34:23) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> max

Re: getopt not raising exception

2010-01-10 Thread Matt Nordhoff
Matthew Lear wrote: > Hello, > > I'm having problems getting getopt to function correctly. Basically, no > exception is being raised if no argument is passed to the code snippet > below. I've read the Python documentation and tried example code from > various sources which should cause an exceptio

getopt not raising exception

2010-01-10 Thread Matthew Lear
Hello, I'm having problems getting getopt to function correctly. Basically, no exception is being raised if no argument is passed to the code snippet below. I've read the Python documentation and tried example code from various sources which should cause an exception, only they don't. I've also tr

Re: Prepend to logging message

2010-01-10 Thread Joan Miller
On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote: > Joan Miller wrote: > > How to prepend anything to a logging message? Is possible to do it > > from the dictionary object (ExtraLog) or is there is that override > > process() [1]? > > > -- > > class ExtraLog(object): > > >  

Re: Porblem with xlutils/xlrd/xlwt

2010-01-10 Thread John Machin
On Jan 10, 8:51 pm, pp wrote: > On Jan 9, 8:23 am, John Machin wrote: > > > > > On Jan 9, 9:56 pm, pp wrote: > > > > On Jan 9, 3:52 am, Jon Clements wrote: > > > > > On Jan 9, 10:44 am, pp wrote: > > > > > > On Jan 9, 3:42 am, Jon Clements wrote: > > > > > > > On Jan 9, 10:24 am, pp wrote: >

(non-python) upgrading a MySQL database

2010-01-10 Thread Dikkie Dik
>> ... And I am interested in cleaning this up. I should probably >> start with the matter of databases, since that's something I won't be able >> to easily change once clients actually start entering data. Please share >> with me any further concepts or questions to get me thinking how to redesign

Re: Prepend to logging message

2010-01-10 Thread Peter Otten
Joan Miller wrote: > How to prepend anything to a logging message? Is possible to do it > from the dictionary object (ExtraLog) or is there is that override > process() [1]? > > -- > class ExtraLog(object): > > def __getitem__(self, name): > if name == 'foo': >

Re: Porblem with xlutils/xlrd/xlwt

2010-01-10 Thread pp
On Jan 9, 8:23 am, John Machin wrote: > On Jan 9, 9:56 pm, pp wrote: > > > On Jan 9, 3:52 am, Jon Clements wrote: > > > > On Jan 9, 10:44 am, pp wrote: > > > > > On Jan 9, 3:42 am, Jon Clements wrote: > > > > > > On Jan 9, 10:24 am, pp wrote: > > > > yeah all my versions are latest fromhttp:/

Re: Computer Music Toolkit (CMT) ?

2010-01-10 Thread Stefan Behnel
Peter Billam, 10.01.2010 10:15: Greetings. Is there a way to get at the Computer Music Toolkit (CMT) http://www.ladspa.org/cmt/ functionality from Python (Python3 in my case) ? Googling is confusing because of www.cmt.com and cmt-graph and openscientist.lal.in2p3.fr/v9/cmt.html and pyAMISecure

Re: Prepend to logging message

2010-01-10 Thread Joan Miller
On 10 ene, 03:27, Ishwor Gurung wrote: > Joan, > > 2010/1/10 Joan Miller : > > > > > How to prepend anything to a logging message? Is possible to do it > > from the dictionary object (ExtraLog) or is there is that override > > process() [1]? > > > -- > > class ExtraLog(object): > >

Re: Direct use of bytearray buffers with ctypes ?

2010-01-10 Thread Pakal
Oki, it seems I've found. To directly use a bytearray buffer from ctypes, you must first create a compatible ctypes type (I.E, a char array of same size), and only then instanciate this new type with newtype.from_buffer (bytearray_object). The little danger is : you must NOT change the size of by

Computer Music Toolkit (CMT) ?

2010-01-10 Thread Peter Billam
Greetings. Is there a way to get at the Computer Music Toolkit (CMT) http://www.ladspa.org/cmt/ functionality from Python (Python3 in my case) ? Googling is confusing because of www.cmt.com and cmt-graph and openscientist.lal.in2p3.fr/v9/cmt.html and pyAMISecure_and_cmt and so on... Regards, P

Re: lightweight encryption of text file

2010-01-10 Thread Daniel Fetchinson
>> I have a plain text file which I would like to protect in a very >> simple minded, yet for my purposes sufficient, way. I'd like to >> encrypt/convert it into a binary file in such a way that possession of >> a password allows anyone to convert it back into the original text >> file while not po

Re: lightweight encryption of text file

2010-01-10 Thread Nobody
On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote: > I have a plain text file which I would like to protect in a very > simple minded, yet for my purposes sufficient, way. I'd like to > encrypt/convert it into a binary file in such a way that possession of > a password allows anyone to c

Re: Ask how to use HTMLParser

2010-01-10 Thread Nobody
On Fri, 08 Jan 2010 11:44:48 +0800, Water Lin wrote: > I am a new guy to use Python, but I want to parse a html page now. I > tried to use HTMLParse. Here is my sample code: > -- > from HTMLParser import HTMLParser Note that HTMLParser only tokenises HTML; it doesn't actually

Re: subprocess.Popen does not close pipe in an error case

2010-01-10 Thread Nobody
On Wed, 06 Jan 2010 19:05:40 -0800, Steven K. Wong wrote: > Well, the example code at > http://www.python.org/ ... /subprocess.html#replacing-shell-pipeline > has the same issue: > Perhaps the doc can be improved to remind folks to close p1.stdout if > the calling process doesn't need it, unless