[Python-Dev] PyOS_InputHook enhancement proposal

2004-12-08 Thread Michiel Jan Laurens de Hoon
PyOS_InputHook is a pointer to a function that is called periodically (ten times per second) while Python is idle, for example, when waiting for a user command. Python C extension modules can set this pointer to a hook function defined in the extension module. For example, _tkinter.c makes use of P

Re: [Python-Dev] The other Py2.4 issue

2004-12-10 Thread Michiel Jan Laurens de Hoon
E.g. if we need to compile libpython24.a it means we need to fetch the Python sources themselves first. Actually, no, you don't need the sources. See: http://mail.python.org/pipermail/python-dev/2004-January/041676.html for a script that builds libpython24.a from the python24.lib distributed wit

Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Mac/OSX fixapplepython23.py, 1.1, 1.2

2004-12-29 Thread Michiel Jan Laurens de Hoon
Jack Jansen wrote: Also, could you point me to a readily available extension package that uses c++? The Bio.Affy and Bio.KDTree extensions in Biopython use c++. See www.biopython.org. --Michiel. -- Michiel de Hoon, Assistant Professor University of Tokyo, Institute of Medical Science Human Genome

[Python-Dev] PyOS_InputHook and threads

2005-01-12 Thread Michiel Jan Laurens de Hoon
does the second thread go idle? --Michiel. On Thu, Dec 09, 2004, Michiel Jan Laurens de Hoon wrote: My suggestion is therefore to replace PyOS_InputHook by two functions PyOS_AddInputHook and PyOS_RemoveInputHook, and let Python keep track of which hooks are installed. This way, an extension module

[Python-Dev] Patch review [ 684500 ] extending readline functionality

2005-01-18 Thread Michiel Jan Laurens de Hoon
Patch review [ 684500 ] (extending readline functionality) This patch is a duplicate of patch [ 675551 ] (extending readline functionality), which was first submitted against stable python version 2.2.2. After the resubmitted patch [ 684500 ] against Python 2.3a1 was accepted (Modules/readline.c

[Python-Dev] Patch review [ 723201 ] PyArg_ParseTuple problem with 'L' format

2005-01-20 Thread Michiel Jan Laurens de Hoon
Patch review [ 723201 ] PyArg_ParseTuple problem with 'L' format The PyArg_ParseTuple function (PyObject *args, char *format, ...) parses the arguments args and stores them in the variables specified following the format argument. If format=="i", indicating an integer, but the corresponding Python

[Python-Dev] Patch review [ 1093585 ] sanity check for readline remove/replace

2005-01-20 Thread Michiel Jan Laurens de Hoon
Patch review [ 1093585 ] sanity check for readline remove/replace The functions remove_history_item and replace_history_item in the readline module respectively remove and replace an item in the history of commands. As outlined in bug [ 1086603 ], both functions cause a segmentation fault if the it

[Python-Dev] Patch review [ 981773 ] crach link c++ extension by mingw

2005-02-08 Thread Michiel Jan Laurens de Hoon
Patch review [ 981773 ] crach link c++ extension by mingw When building a C++ extension for Windows using MinGW, the linking would fail due to an incorrect link command. The patch contains a solution for this problem. I could reproduce this bug with Python 2.3.5c1, but in Python 2.4 it seems to

[Python-Dev] Patch review & request

2005-02-27 Thread Michiel Jan Laurens de Hoon
This is my last patch review in a series of five; next time I'll send them in a bunch of five as requested. I reviewed the following patches: [ 684500 ] extending readline functionality [ 723201 ] PyArg_ParseTuple problem with 'L' format [ 981773 ] crach link c++ extension by mingw [ 985713 ] bug

[Python-Dev] A bunch of patch reviews

2005-03-27 Thread Michiel Jan Laurens de Hoon
Below are a set of five patch reviews. I don't have any patch to push for at this point, so these patch reviews are just for you to read and enjoy. Thanks everybody for developing and maintaining Python. I wouldn't know what to do without it. --Michiel. Patch [ 853890 ] Optional keyword unicode

[Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-08 Thread Michiel Jan Laurens de Hoon
Dear Pythoneers, I use Python heavily for scientific computing, originally for computational physics and nowadays for computational biology. One of the extension modules I support is pygist, a module for scientific visualization. For this (and similar) packages to work, it is important to have

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-09 Thread Michiel Jan Laurens de Hoon
Martin v. Löwis wrote: > Michiel Jan Laurens de Hoon wrote: > >> 2) Will Tkinter always be the standard toolkit for Python, or are >> there plans to replace it at some point? > > > Python does not evolve along a grand master plan. Instead, individual > contributors

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-09 Thread Michiel Jan Laurens de Hoon
Greg Ewing wrote: >I'm not sure the event-loop situation would be >much different with another one, anyway. From what >I've seen of GUI toolkits, they all have their own >form of event loop, and they all provide some way >of hooking other things into it (as does Tkinter), >but whichever one you're

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-09 Thread Michiel Jan Laurens de Hoon
Stephen J. Turnbull wrote: >Michiel> What is the advantage of Tk in comparison to other GUI >Michiel> toolkits? > >IMO, Tk's _advantage_ is that it's there already. As a standard >component, it works well for typical simple GUI applications (thus >satisfying "batteries included" IMO), and

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-10 Thread Michiel Jan Laurens de Hoon
Martin v. Löwis wrote: > Michiel Jan Laurens de Hoon wrote: > >> It's not because it likes to be in charge, it's because there's no >> other way to do it in Python. > > As I said: this is simply not true. You are right in the sense it is possible to get

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-10 Thread Michiel Jan Laurens de Hoon
Guido van Rossum wrote: >On 11/9/05, Michiel Jan Laurens de Hoon <[EMAIL PROTECTED]> wrote: > > >>My application doesn't need a toolkit at all. My problem is that because >>of Tkinter being the standard Python toolkit, we cannot have a decent >>event loop

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter - Summary attempt

2005-11-11 Thread Michiel Jan Laurens de Hoon
I think this is an excellent summary of the discussion so far. Probably clearer than my own posts. Thanks, Jim! --Michiel. Jim Jewett wrote: >There has been enough misunderstanding in this thread >that the summarizers are going to have trouble. So I'm >posting this draft in hopes of clarificat

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread Michiel Jan Laurens de Hoon
Martin v. Löwis wrote: >Before trying to explain the reason, please try to explain the >problem first. What is it *really* that you want to do which >you feel you currently can't do? > > Probably I should have started the discussion with this; sorry if I confused everybody. But here it is: I h

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Michiel Jan Laurens de Hoon
Martin v. Löwis wrote: >Michiel Jan Laurens de Hoon wrote: > > >>The problem with threading (apart from potential portability problems) >>is that Python doesn't let us know when it's idle. This would cause >>excessive repainting (I can give you an exp

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Michiel Jan Laurens de Hoon
Greg Ewing wrote: >Michiel Jan Laurens de Hoon wrote: > > >>I have an extension module for scientific visualization. This extension >>module opens one or more windows, in which plots can be made. >> >> > >What sort of windows are these? Are you usi

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Michiel Jan Laurens de Hoon
[EMAIL PROTECTED] wrote: >If I have a Gtk app I have to feed other (socket, callback) pairs to it. It >takes care of adding it to the select() call. Python could dictate that the >way to play ball is for other packages (Tkinter, PyGtk, wxPython, etc) to >feed Python the (socket, callback) pair.

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Michiel Jan Laurens de Hoon
Noam Raphael wrote: >On 11/13/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > > >>Noam Raphael wrote: >> >> >>>All that is needed to make Tkinter and Michiels' >>>code run together is a way to say "add this callback to the input >>>hook" instead of the current "replace the current input hook wit

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Michiel Jan Laurens de Hoon
Martin v. Löwis wrote: >Michiel Jan Laurens de Hoon wrote: > > >>But there is another solution with threads: Can we let Tkinter run in a >>separate thread instead? >> >> > >Yes, you can. Actually, Tkinter *always* runs in a separate thread >(separ

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Michiel Jan Laurens de Hoon
Greg Ewing wrote: >Michiel Jan Laurens de Hoon wrote: > > >>Greg Ewing wrote: >> >> >>>How about running your event loop in a separate thread? >>> >>> >>I agree that this works for some extension modules, but not very well

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-13 Thread Michiel Jan Laurens de Hoon
Fernando Perez wrote: >Michiel Jan Laurens de Hoon wrote: > > >>For an extension module such as >>PyGtk, the developers may decide that PyGtk is likely to be run in >>non-interactive mode only, for which the PyGtk mainloop is sufficient. >> >> >

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-14 Thread Michiel Jan Laurens de Hoon
[EMAIL PROTECTED] wrote: >Ronald> ... except when the GUI you're using doesn't expose (or even >Ronald> use) a file descriptor that you can use with select. Not all the >Ronald> world is Linux. > >Can you be more specific? Are you referring to Windows? I'm not suggesting >you'd be ab

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-14 Thread Michiel Jan Laurens de Hoon
Ronald Oussoren wrote: > I wonder why nobody has suggested a seperate thread for managing the > GUI and > using the hook in Python's event loop to issue the call to update_plot. > Ha. That's probably the best solution I've heard so far, short of adding a Tcl-like event loop API to Python. There

[Python-Dev] Conclusion: Event loops, PyOS_InputHook, and Tkinter

2005-11-15 Thread Michiel Jan Laurens de Hoon
Thanks everybody for contributing to this discussion. I didn't expect it to become this extensive. I think that by now, everybody has had their chance to voice their opinion. It seems safe to conclude that there is no consensus on this topic. So what I'm planning to do is to write a small extensi

Re: [Python-Dev] Conclusion: Event loops, PyOS_InputHook, and Tkinter

2005-11-15 Thread Michiel Jan Laurens de Hoon
Phillip J. Eby wrote: > At 06:48 PM 11/15/2005 -0500, Michiel Jan Laurens de Hoon wrote: > >> Thanks everybody for contributing to this discussion. I didn't expect it >> to become this extensive. >> I think that by now, everybody has had their chance to voice their