Restarting a daemon

2011-04-26 Thread Jeffrey Barish
er when it sends the terminate signal to the old myserver. If so, what is the correct way to restart the daemon? Will it work to run the restart command in a subprocess rather than a subshell or will a subprocess also terminate when its parent terminates? -- Jeffrey Barish -- http://mail.

Re: Problem with multithreading

2009-06-25 Thread Jeffrey Barish
Lou Pecora wrote: > In article , > "larudwer" wrote: > >> "Jeffrey Barish" schrieb im Newsbeitrag >> news:mailman.2091.1245902997.8015.python-l...@python.org... >> > Jeffrey Barish wrote: >> > >> >> I have a program that

Re: Problem with multithreading

2009-06-24 Thread Jeffrey Barish
Jeffrey Barish wrote: > I have a program that uses multithreading to monitor two loops. When > something happens in loop1, it sends a message to loop2 to have it execute > a command. loop2 might have to return a result. If it does, it puts the > result in a queue. loop1, meanwhile

Problem with multithreading

2009-06-24 Thread Jeffrey Barish
echniques to illustrate the problem, but the test program works perfectly. I could post it, though, if it would help to understand what I am doing -- and what might be wrong in the real program. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Threads and daemon processes

2009-05-08 Thread Jeffrey Barish
ate a thread? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Beep

2008-12-22 Thread Jeffrey Barish
Tobias Andersson wrote: > Jeffrey Barish skrev: >> Chris Rebert wrote: >>> Is the 'pcspkr' kernel module built and loaded? >> >> Yes. And I should have mentioned that I get sound from Ubuntu >> applications that produce sound. > > Also, is

Re: Beep

2008-12-21 Thread Jeffrey Barish
Chris Rebert wrote: > > Is the 'pcspkr' kernel module built and loaded? Yes. And I should have mentioned that I get sound from Ubuntu applications that produce sound. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Beep

2008-12-21 Thread Jeffrey Barish
I use sys.stdout.write('\a') to beep. It works fine on Kubuntu, but not on two other platforms (one of which is Ubuntu). I presume that the problem is due to a system configuration issue. Can someone point me in the right direction? Thanks. -- Jeffrey Barish -- http://mail.python.o

Re: Multiprocessing vs. [Pyro, RPyC]

2008-11-14 Thread Jeffrey Barish
. So I thought at first, but then I saw this statement in the documentation: It is possible to run a manager server on one machine and have clients use it from other machines (assuming that the firewalls involved allow it). -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Multiprocessing vs. [Pyro, RPyC]

2008-11-14 Thread Jeffrey Barish
With the release of multiprocessing in Python 2.6, is there any reason to use Pyro or RPyC? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Single-instance daemons

2008-11-12 Thread Jeffrey Barish
o a user anyway. Still, I like your suggestion, so I'll remember it for another occasion. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Single-instance daemons

2008-11-12 Thread Jeffrey Barish
ely, you can reclaim > root at cleanup as it's stored as your saved UID. Nice. One thing: how do I get the uid and gid for the target user? In general, I know the name of the target user, but the uid/gid assigned by the OS to that user could be different on different systems. -- Jef

Single-instance daemons

2008-11-12 Thread Jeffrey Barish
assing the name of the daemon and the pid and give the executable suid root, but that's a lot of bother. Has anyone else dealt with this problem? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Regular expressions and Unicode

2008-10-02 Thread Jeffrey Barish
rname_re.search(name) m.groups() ('Dvo\xc5',) I suppose that there is an encoding problem, but I don't understand Unicode well enough to know what to do to digest properly the Unicode characters in the surname. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem using copy.copy with my own class

2008-04-24 Thread Jeffrey Barish
a situation in the full program where pickling seems to be failing in the same manner as copy, but I have not been able yet to reproduce the problem in a simple test program. Thanks to all for your comments. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem using copy.copy with my own class

2008-04-23 Thread Jeffrey Barish
uot;/usr/lib/python2.5/copy.py", line 95, in copy return _reconstruct(x, rv, 0) File "/usr/lib/python2.5/copy.py", line 322, in _reconstruct y = callable(*args) File "/usr/lib/python2.5/copy_reg.py", line 92, in __newobj__ return cls.__new__(cls, *args) T

Problem using copy.copy with my own class

2008-04-22 Thread Jeffrey Barish
surmise that pickle uses copy. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: __init__.py file

2008-04-09 Thread Jeffrey Barish
port the object in file{1,2}.py with import dirA.dirB.my_object or from dirA.dirB import my_object. I use the technique only with objects that are legitimately global. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: for-else

2008-03-10 Thread Jeffrey Barish
ntent with the current solution. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: for-else

2008-03-06 Thread Jeffrey Barish
that are comparable. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending Python statement over socket in chunks

2008-02-11 Thread Jeffrey Barish
tement, so I have to carve up the list as source. Using Pyro to send the chunks once I have them should work fine. Note that I am avoiding the use of the term "slice". It is not possible to slice the list in the way that we normally do in Python because it is still in the form of a str

Sending Python statement over socket in chunks

2008-02-11 Thread Jeffrey Barish
some number of Things delimited by "Thing(" at one end and "),\nThing(" at the other (or ")]\n" at the end of the list). Did I just answer my own question? Of course, I need to balance the complexity of any alternative solution against simply executing the statemen

Re: Biased random?

2007-08-31 Thread Jeffrey Barish
I'm sorry that I took the time to respond. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Biased random?

2007-08-31 Thread Jeffrey Barish
Robert Kern wrote: > Ivan Voras wrote: >> Jeffrey Barish wrote: >> >>> If you take the difference between two uniformly distributed random >>> variables, the probability density function forms an isosceles triangle >>> centered at 0. Take the absolute v

Re: Biased random?

2007-08-28 Thread Jeffrey Barish
ween two uniformly distributed random variables, the probability density function forms an isosceles triangle centered at 0. Take the absolute value of that variable and the pdf is a straight line with maximum value at 0 tapering to 0 at max. Thus, z = abs(randint(0, max) - randint(0, max))

Moving class used in pickle

2007-05-15 Thread Jeffrey Barish
o update the pickle? The only thought I have is to read all the data with the old class module, store the data in some nonpickle format, and then, with another program, read the nonpickle-format file and rewrite the pickle with the class module in the new location. -- Jeffrey Barish -- http:/

Using DCOP from Python

2006-12-18 Thread Jeffrey Barish
korganizer.CalendarIface.openJournalEditor(QString text, QDate date) but I'm having trouble figuring out how to call this function from Python. And will it become clear how to control whether I am reading or writing the journal? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Adding a comment to an image using PIL

2006-10-30 Thread Jeffrey Barish
rsing this procedure: im.app['COM'] = 'New comment' im.save('newfilename.jpg') However, when I open newfilename.jpg, I find that key 'COM' does not exist -- the comment is not being written. Presumably, I am doing something wrong. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Record Audio Analysis

2006-08-24 Thread Jeffrey Barish
t; > I think it allows the features you want. > > Frank. Or try PySonic (http://pysonic.sourceforge.net/) if you prefer a package that actually works. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Controlling Windows Media Player from Python

2006-07-03 Thread Jeffrey Barish
Is there a way to interact with Windows Media Player from Python? I would like to be able to do things like tell WMP to play a given sound file or to ask WMP for metadata about a sound file. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Popen3 on Windows

2006-06-17 Thread Jeffrey Barish
see os.popen2 and os.popen3, but they provide only file objects for stdin, stdout, and stderr so I don't see a way to kill the auxiliary program that I start. Is there a way to do this on Windows? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging a pickle

2006-06-08 Thread Jeffrey Barish
dows and I was not opening the file in binary mode either for input or output. I am amazed that it worked at all. Thanks for the suggestion. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Debugging a pickle

2006-06-07 Thread Jeffrey Barish
that the dump did not write as much data as it should have. Is that assumption correct? Are there any debugging techniques I can use to figure out what is going wrong? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Name conflict in class hierarchy

2006-05-20 Thread Jeffrey Barish
of A that I would like to use. It struck me that this must be a common problem in OOP, so I'm wondering whether there is a simple solution that I am missing. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Multithreading and Queue

2006-04-25 Thread Jeffrey Barish
bunch of code between the point where a thread releases a lock and then actually returns to the calling program) and so despite the locks in Queue it is still possible for values to change before a thread acts on them. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser: writes a list but reads a string?

2006-01-22 Thread Jeffrey Barish
atibility is also desirable. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Import DiscID on Windows

2005-04-25 Thread Jeffrey Barish
is in the search path, so I presume that there is something wrong with the dll. Any suggestions? Can Python import a file with a dll extension? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Adapting code to multiple platforms

2005-03-11 Thread Jeffrey Barish
I'm wondering whether I have missed something obvious. I'm hoping that the strongest rebuke would be that I found something obvious. -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4 and Tkinter

2004-12-03 Thread Jeffrey Barish
Eric Brunel wrote: > Jeffrey Barish wrote: > [snip] >> OK, I downloaded tcl8.4.8 and tk8.4.8. They are now installed. Back >> to >> python2.4 make. It now bombs at: >> >> gcc -pthread -shared build/temp.linux-i686-2.4/_tkinter.o >> build/temp.lin

Re: Python 2.4 and Tkinter

2004-12-02 Thread Jeffrey Barish
t; >> > But the Tcl/Tk libraries to build the _tkinter module are coming >> > from >> > /usr/local/lib in our case. And those happens to be tcl83 and tk83 >> > in our case. >> > >> > If the Tcl/Tk libraries (and include files) are missing, yo

Re: Python 2.4 and Tkinter

2004-12-02 Thread Jeffrey Barish
stall those. But they are not part of the Python > distribution, as far as we know. > > /Jean Brouwers > > > > In article <[EMAIL PROTECTED]>, > Jeffrey Barish <[EMAIL PROTECTED]> wrote: > >> Jean Brouwers wrote: >> >> > >&

Re: Python 2.4 and Tkinter

2004-12-01 Thread Jeffrey Barish
Jean Brouwers wrote: > > FWIW, we just installed Python 2.4 (on RH Linx 8), rebuilt it from > scratch and everything is fine. Tkinter is there, _tkinter as well > and idle comes up as expected. > > /Jean Brouwers > > > > In article <[EMAIL PROTECTED]>

Python 2.4 and Tkinter

2004-12-01 Thread Jeffrey Barish
how to make Tkinter work under Python 2.4? I also don't understand why I have to go to all this trouble. Tkinter is supposed to be included with Python, so shouldn't it be available without any special effort? -- Jeffrey Barish -- http://mail.python.org/mailman/listinfo/python-list