From: Andre W. <wo...@us...> - 2004-11-18 06:50:24
|
Hi Greg, On 17.11.04, Greg Novak wrote: > When I run python as an inferior process under Emacs and try to use > PyX, I get a mysterious error: > > import pyx > g=pyx.graph.graphxy(width=8) > g.plot(pyx.graph.data.list([[1,2],[2,4],[3,9]],x=1,y=2)) > g.writeEPSfile('gsn'); > > results in: > > Process Python hangup While I'm not using python-mode.el (indeed, I'm not using emacs at all ... I'm just to stupid to even quit this editor without the help of the kill command -- others will tell that for vi(m), but let us not stress this issue further), I have a wild guess. You're right, it might be, that the process does not stop, since PyX did not yet quit the underlaying TeX instance. It depends on whether you're using the ipc-mode of PyX. Usually we have a _cleantmp call started via atexit(), but this "terminate-all-signal" might not be issued in your case. We also use setDaemon in the TeX observing thread to prevent this thread from locking the finish of python, but still, in your case, this might not be helpfull. What you can do first, is to look for a still running tex process when your example was run and than the process comes to a hang. If there is such a process, just try to call text.reset() in the end. It will quit the current TeX instance from the default texrunner. In case this helps, you may switch to the none-ipc-mode of TeX, which needs to quit TeX at those times, when the dvi file needs to be accessed. (While the texrunner is able to start new TeX instances when needed, you should not notice a functional difference between these two operating modes. But it makes a difference in running time for certain operations, where the access to the dvi data is needed intermediately.) You can disable the ipc-mode in the pyxrc (either the systemwide pyxrc or the users ~/.pyxrc). Or you strick on the explicit reset-call at the end of your script (which is better, since you can still take advantage of the ipc-functionality of TeX). Still, I'm not sure whether this whole topic is related to your problem, but its worth a try. André -- by _ _ _ Dr. André Wobst / \ \ / ) wo...@us..., http://www.wobsta.de/ / _ \ \/\/ / PyX - High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ |