a couple IDLE questions

Skip Montanaro skip at mojam.com
Wed Sep 8 13:10:25 EDT 1999


I just tried IDLE for the first time.  I have a few questions:

    1.  It seems to ignore my PYTHONSTARTUP environment variable.  Any
        particular reason why?

    2.  I point the above variable at ~/.pythonrc.  When I open that file,
        it doesn't colorize it, I suppose since it doesn't end in ".py".  Is 
        there a way to force it to treat a file as Python source when it
        normally wouldn't (like, perhaps recognizing "-*- python -*-" like
        Emacs does)?

    3.  The class browser presents all classes and functions defined at the
        top level of a module.  Should it perhaps be called a module browser
        and be expanded to present all objects defined at the module's outer
        scope?

When I asked for the class browser on my .pythonrc file it generated a
traceback

        Exception in Tkinter callback
        Traceback (innermost last):
          File "/usr/local/lib/python1.5/lib-tk/Tkinter.py", line 764, in __call__
            return apply(self.func, args)
          File "EditorWindow.py", line 337, in open_class_browser
            ClassBrowser.ClassBrowser(self.flist, base, [head])
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/ClassBrowser.py", line 35, in __init__
            self.init(flist)
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/ClassBrowser.py", line 57, in init
            node.expand()
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/TreeWidget.py", line 132, in expand
            self.update()
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/TreeWidget.py", line 171, in update
            self.draw(7, 2)
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/TreeWidget.py", line 185, in draw
            sublist = self.item._GetSubList()
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/TreeWidget.py", line 332, in _GetSubList
            sublist = self.GetSubList()
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/ClassBrowser.py", line 79, in GetSubList
            for name in self.listclasses():
          File "/home/dolphin/skip/src/python.org/dist/src/Tools/idle/ClassBrowser.py", line 106, in listclasses
            if cl.module == name:
        AttributeError: module

even though it contains only valid Python code (though no function or class
definitions).

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/~skip/
847-971-7098   | Python: Programming the way Guido indented...




More information about the Python-list mailing list