schedule at specific hours

2006-08-11 Thread Yves Glodt
Hi there, I have a daemon running 24/7, and I want that it executes a certain function several times a day, as specified in an configfile (e.g. actiontimes=10:00,12:00,19:00) Do I have to fiddle with sched.scheduler and calc. time differences to schedule my events, or is there another (nicer..

Activate a daemon several times a day

2006-07-06 Thread Yves Glodt
Hi, I have a daemon which runs permanently, and I want it to do a special operation at some specifiy times every day, consider this configfile extract: [general] runat=10:00,12:00 What would be the easiest and most pythonic way to do this? Something like this pseudocode: while True:

pyqt show wizard

2006-06-07 Thread Yves Glodt
Hi, I have a mainwindow in my pyqt application, and on click of a button I want to start an assistant (wizard). I have create the wizard with the Qt Designer, generated the python code with pyuic, imported it "from assistant import *", and subclassed it as usual. To show it, the onclick metho

Re: encoding problem

2006-03-08 Thread Yves Glodt
#x27;é' as well :-( How am I supposed to print non-ascii characters the correct way? best regards, Yves > Sebastjan > > On 3/3/06, Yves Glodt <[EMAIL PROTECTED]> wrote: >> Hi list, >> >> >> Playing with the great pysvn I get this problem: >>

encoding problem

2006-03-03 Thread Yves Glodt
Hi list, Playing with the great pysvn I get this problem: Traceback (most recent call last): File "D:\avn\mail.py", line 80, in ? mailbody += diff UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 10710: ordinal not in range(128) It seems the pysvn.client.diff fun

Re: Python threading, and processes

2006-02-08 Thread Yves Glodt
Robin Haswell wrote: > Hey there > > I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and > Debian machines, and I've noticed that if I open a lot of threads (say, > 50), I get lots of python processes with individual PIDs, which consume a > disproportionate amount of CPU. Does

Re: test whether 2 objects are equal

2006-01-31 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: >> Hello, >> >> >> I need to compare 2 instances of objects to see whether they are equal >> or not, but with the code down it does not work (it outputs "not equal") >> >> >> #!/usr/bin/python

Re: test whether 2 objects are equal

2006-01-31 Thread Yves Glodt
Rene Pijlman wrote: > Yves Glodt: >> I need to compare 2 instances of objects to see whether they are equal >> or not, > > This prints "equal": thank you! Have a nice day, Yves > class Test(object): > def __init__(self): > self.var1 = &#

test whether 2 objects are equal

2006-01-31 Thread Yves Glodt
Hello, I need to compare 2 instances of objects to see whether they are equal or not, but with the code down it does not work (it outputs "not equal") #!/usr/bin/python class Test: var1 = '' var2 = '' test1 = Test() test1.var1 = 'a' test1.var2 = 'b' test2 = Test() test2.var1

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Paul Rubin wrote: > Yves Glodt <[EMAIL PROTECTED]> writes: >> that means I can neither have a dictionary with 2 identical keys but >> different values...? > > No. > >> I would need e.g. this: >> (a list of ports and protocols, to be treated later in a

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Yves Glodt wrote: > Hi there, > > I seem to be unable to find a way to appends more keys/values to the end > of a dictionary... how can I do that? > > E.g: > > mydict = {'a':'1'} > > I need to append 'b':'2' to it to have

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Rene Pijlman wrote: > Yves Glodt: >> I seem to be unable to find a way to appends more keys/values to the end >> of a dictionary > > A dictionary has no order, and therefore no end. that means I can neither have a dictionary with 2 identical keys but different values..

append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Hi there, I seem to be unable to find a way to appends more keys/values to the end of a dictionary... how can I do that? E.g: mydict = {'a':'1'} I need to append 'b':'2' to it to have: mydict = {'a':'1','b':'2'} How to do? Best regards, Yves -- http://mail.python.org/mailman/listinfo/pyt

python-soappy

2006-01-11 Thread Yves Glodt
Hi list, can anybody point me to a tutorial, howto or example code of python-soappy...? google did not have really useful results about... Best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

heartbeats

2005-12-09 Thread Yves Glodt
Hi, I need to write a heartbeat solution to monitor some external clients, and what is different as in the examples that I have seen so far is that I want my central server to poll the clients, and not the clients "pinging" the central server. In detail I need a daemon on my central server whi

Re: spawnle & umask

2005-12-08 Thread Yves Glodt
David Wahler wrote: > Yves Glodt wrote: >> It does, I did like this: >> >> os.umask(0113) >> newpid = >> os.spawnl(os.P_NOWAIT,'/usr/local/bin/wine','/usr/local/bin/wine',executable) >> >> But I wanted to use spawnle and it's

Re: spawnle & umask

2005-12-08 Thread Yves Glodt
Fredrik Lundh wrote: > Yves Glodt wrote: > >> I tried something like this but the umask part does not work clearly...: >> >> newpid = >> os.spawnle(os.P_NOWAIT,'/usr/bin/touch','/usr/bin/touch','xyz','umask 0113') >&g

spawnle & umask

2005-12-08 Thread Yves Glodt
Hi, I tried something like this but the umask part does not work clearly...: newpid = os.spawnle(os.P_NOWAIT,'/usr/bin/touch','/usr/bin/touch','xyz','umask 0113') What would be the correct syntax for setting the umask for the created process...? Best regards, Yves -- http://mail.python.org/

Re: Python, Linux, Desktop Environment

2005-11-16 Thread Yves Glodt
> [EMAIL PROTECTED] wrote: > >> So, I've written my first GUI app in python. I've turned it into a >> binary .exe and .app that runs on Windows and Mac respectively, but on >> my Linux box, where I wrote the thing, I still have to drop to the >> command line and ./myscript.py. What can I do t

[Twisted-Python] ssh tunnel

2005-11-16 Thread Yves Glodt
(I asked about this several times in the twisted list but never got an answer, maybe here I'll more happy...) Hi, I'm new to conch and I wonder if somebody could point me to an example of how to create an ssh tunnel with conch to forward a connection (e.g. database or vnc) through that tunnel (i

Re: Pregunta sobre python

2005-11-14 Thread Yves Glodt
Andres de la Cuadra wrote: > Hola, me llamo Andres de la cuadra, soy un usuario de python en chile y me > gustaría saber como puedo cerrer un programa a través de python. Yo se que > con la librería os puedo ejecutar programas, pero no e encontrado una > librería para poder cerrarlos Hola Andres,

Clone an object

2005-11-14 Thread Yves Glodt
Hello, how can I clone a class instance? I have trouble finding that in the documentation... thanks and best regards, Yves -- http://mail.python.org/mailman/listinfo/python-list

Re: how to start a process and get it's pid?

2005-11-11 Thread Yves Glodt
Gerhard Häring wrote: > Yves Glodt wrote: >> Hello, >> >> another question rose for me today... >> >> Is there a way to start an external process, in it's own context (not as >> the exec-() functions do), and get it's pid...? [...] > > Che

how to start a process and get it's pid?

2005-11-11 Thread Yves Glodt
Hello, another question rose for me today... Is there a way to start an external process, in it's own context (not as the exec-() functions do), and get it's pid...? e.g.: pid = wonderfulstartprocfunction('/usr/bin/wine bla.exe') #... later if (...): os.kill(pid,9) best regards, Yve

Re: iterate over class variables

2005-11-10 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: >> Yves Glodt wrote: >> >>> Hello list, >>> >>> I need to iterate over a class and get all her variable names and >>> values, e.g. considering this example: >>> >>> >>&g

Re: iterate over class variables

2005-11-10 Thread Yves Glodt
Yves Glodt wrote: > Yves Glodt wrote: >> Hello list, >> >> I need to iterate over a class and get all her variable names and >> values, e.g. considering this example: >> >> >> class testclass: >> var1 = 'ab' >> var2 = &

Re: iterate over class variables

2005-11-10 Thread Yves Glodt
Yves Glodt wrote: > Hello list, > > I need to iterate over a class and get all her variable names and > values, e.g. considering this example: > > > class testclass: > var1 = 'ab' > var2 = 'cd' > var3 = 'ef' >

iterate over class variables

2005-11-10 Thread Yves Glodt
Hello list, I need to iterate over a class and get all her variable names and values, e.g. considering this example: class testclass: var1 = 'ab' var2 = 'cd' var3 = 'ef' test = testclass() Then I wanna do sonmething like this: for name,value in test: print n

Re: append to non-existing list

2005-11-10 Thread Yves Glodt
[EMAIL PROTECTED] wrote: > Yves Glodt wrote: >> Which raises another question... :-) >> >> Is there a possibility to bring together apache and python in a way that >> I can embed python into html? > What do you mean ? I need this (invalid example-html follows):

Re: append to non-existing list

2005-11-10 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: > (snip) >> ok I see your point, and python's... >> >> (just FYI, and not to start a flamewar ;-): >> In php, the [] means "append to an array object". > > yes, I know this. > >> If the array

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
Max M wrote: > Yves Glodt wrote: >> bruno at modulix wrote: >> >>> Yves Glodt wrote: >>> >>>> Hello, >>>> >>>> if I do this: >>>> >>>> for row in sqlsth: >>>> pkcolumns.append(row[0]

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
[EMAIL PROTECTED] wrote: > Thomas Bellman wrote: >> The next time you go shopping at your local super-market, do >> *not* get a shopping-cart (or shopping-basket, or any similar >> container). As you pick up the things you want to buy, try >> to put them into the non-existing cart. Perhaps you wi

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
bruno at modulix wrote: > Yves Glodt wrote: >> Hello, >> >> if I do this: >> >> for row in sqlsth: >> pkcolumns.append(row[0].strip()) >> etc >> >> >> without a prior: >> >> pkcolumns = []; >> >>

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
Juho Schultz wrote: > Yves Glodt wrote: >> Hello, >> >> if I do this: >> >> for row in sqlsth: >> pkcolumns.append(row[0].strip()) >> etc >> >> >> without a prior: >> >> pkcolumns = []; >> >>

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
by the amount of answers that my question rose, in so little time! thanks all! > There is a lot I don't like about python but if you have to use it, you > have to cope with it. > > Yves Glodt wrote: >> My question is: Is there no way to append to a non existing list? >

Re: append to non-existing list

2005-11-09 Thread Yves Glodt
[EMAIL PROTECTED] wrote: > Yves> My question is: Is there no way to append to a non existing list? > > My question in return is: How is Python supposed to know that pkcolumns is > supposed to be a list instead of some other type of object that happens to > define an append() method? I am fair

append to non-existing list

2005-11-09 Thread Yves Glodt
Hello, if I do this: for row in sqlsth: pkcolumns.append(row[0].strip()) etc without a prior: pkcolumns = []; I get this error on first iteration: UnboundLocalError: local variable 'pkcolums' referenced before assignment I guess that's normal as it's the way python works..