From: Emin.shopper Martinian.s. <emi...@gm...> - 2006-11-16 14:13:03
|
Whenever I try to use matplotlib from a python session inside emacs, python freezes. What I do is start GNU Emacs version 21.1.3 for Windows, do ESC-x shell and enter the commands shown below. Note that I set the backend to PS and interactive to false, but my python interpreter still freezes. I suspect that this is because matplotlib is generating some GUI events which upset emacs. The example works fine if I run python through the shell without emacs, but I would very much like to run python through an emacs session. Similar problems happen with other backends. Any suggestions on how to solve this problem would be much appreciated. Thanks, -Emin -------- Transcript of session follows -------------------------------------------------- Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\>c:\python25\python.exe -i c:\python25\python.exe -i Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> print numpy.__version__ 1.0 >>> import matplotlib, pylab >>> matplotlib.interactive(False) >>> matplotlib.use('PS') >>> def example(size): ... pylab.hist(range(size)) ... print 'made hist of size %i' % size ... return size ... >>> print [example(i) for i in range(10,20)] made hist of size 10 made hist of size 11 made hist of size 12 made hist of size 13 made hist of size 14 made hist of size 15 made hist of size 16 made hist of size 17 made hist of size 18 made hist of size 19 [10, 11, 12, 13, 14, 15, 16, 17, 18, 19] >>> python is now frozen |