automatically import modules upon interpreter invocation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Fetchinson

    automatically import modules upon interpreter invocation

    Hi folks, this seems like a very basic thing but I couldn't find a solution.
    I always do the following after starting the python interpreter (on linux):

    import rlcompleter
    import readline
    readline.parse_ and_bind("tab: complete")

    Is there a way of making python execute the above whenever it starts
    up so that I don't have to type it all the time?

    Cheers,
    Daniel
    --
    Psss, psss, put it down! - http://www.cafepress.com/putitdown
  • Jeffrey Froman

    #2
    Re: automatically import modules upon interpreter invocation

    Daniel Fetchinson wrote:
    Is there a way of making python execute the above whenever it starts
    up so that I don't have to type it all the time?
    Create a script containing these statements, and specify its location with
    the PYTHONSTARTUP environment variable. Your script will run whenever
    python starts.


    Jeffrey

    Comment

    Working...