Re: newbie - How do I import automatically?
- From: "Claudio Grondi" <claudio.grondi@xxxxxxxxxx>
- Date: Wed, 16 Nov 2005 19:34:28 -0000
<bobueland@xxxxxxxxx> schrieb im Newsbeitrag
news:<1132154531.395649.168870@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
> I tried to put the line
> from btools import *
> in several places in PyShell.py
> but to now avail. It does not work, IDLE does not execute it???
> Bob
I have to give up here :-( .
The best solution I am able to come up with is:
def runsource(self, source):
if(source == ''):
source = 'from btools import *'
"Extend base class method: Stuff the source in the line cache first"
filename = self.stuffsource(source)
which performs 'from btools import *' each time you hit return on the
command line without typing anything in the interpreter.
Maybe someone knowledgable in IDLE can share here a better way how to
initialize IDLE with any code valid in the interpreter itself.
Inbetween the above can maybe serve as workaround.
Claudio
.
- Follow-Ups:
- Re: newbie - How do I import automatically?
- From: bobueland
- Re: newbie - How do I import automatically?
- References:
- newbie - How do I import automatically?
- From: bobueland
- Re: newbie - How do I import automatically?
- From: Mike Meyer
- Re: newbie - How do I import automatically?
- From: bobueland
- Re: newbie - How do I import automatically?
- From: Claudio Grondi
- Re: newbie - How do I import automatically?
- From: bobueland
- newbie - How do I import automatically?
- Prev by Date: creating package question
- Next by Date: Re: Can anyone tell me if pygame and Tkinter can work together?
- Previous by thread: Re: newbie - How do I import automatically?
- Next by thread: Re: newbie - How do I import automatically?
- Index(es):
Relevant Pages
|