Function that enters a line at the beginning of a file?

Jason Orendorff jason at jorendorff.com
Tue Jan 15 22:11:11 EST 2002


Steve Holden wrote:
> Alex Martelli wrote:
> > I think I must be missing something.  Why
> >     exec "import my_module"
> > rather than the plain good old
> >     import my_module
> > ...?
> 
> Because the OP said:
> 
> > Now I want to open script_file and shift the whole text one line down,
> > and enter in the top line "import my_module", so that the commands are
> > available without having to enter the import-line myself.
> 
> which Jason took to mean a requirement for importing modules with 
> names not known a priori?

Or because Jason's a dork that wasn't paying attention to what he
was typing?

Could be... could be...

## Jason Orendorff    http://www.jorendorff.com/  ;-)




More information about the Python-list mailing list