help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: running python in emacs


From: Stefan Monnier
Subject: Re: running python in emacs
Date: Thu, 13 Apr 2006 08:19:23 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I've downloaded the python.el mode for emacs but when I
> M-x run-python
> I get the following error....

> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "c:\Emacs\etc\emacs.py", line 23, in ?
>     import os, sys, traceback, inspect, rlcompleter, __main__
>   File "c:\Python24\lib\rlcompleter.py", line 42, in ?
>     import readline
> ImportError: No module named readline
>>>> >>>


> any suggestions on how to correct this problem?

Does the patch below fix your problem?


        Stefan


Index: etc/emacs.py
===================================================================
RCS file: /sources/emacs/emacs/etc/emacs.py,v
retrieving revision 1.6
diff -u -r1.6 emacs.py
--- etc/emacs.py        5 Feb 2006 23:44:47 -0000       1.6
+++ etc/emacs.py        13 Apr 2006 12:20:20 -0000
@@ -20,7 +20,10 @@
 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 # Boston, MA 02110-1301, USA.
 
-import os, sys, traceback, inspect, rlcompleter, __main__
+import os, sys, traceback, inspect, __main__
+# The rlcompleter module seems to only be available in Unix for now.
+try: import rlcompleter
+except: pass
 
 __all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"]
 
@@ -69,8 +72,8 @@
     """Complete TEXT in NAMESPACE and print a Lisp list of completions.
     NAMESPACE is currently not used."""
     if namespace is None: namespace = __main__.__dict__
-    c = rlcompleter.Completer (namespace)
     try:
+        c = rlcompleter.Completer (namespace)
         if '.' in text:
             matches = c.attr_matches (text)
         else:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]