Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
automatically import modules upon interpreter invocation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel Fetchinson  
View profile  
 More options Jun 25 2008, 4:03 am
Newsgroups: comp.lang.python
From: "Daniel Fetchinson" <fetchin...@googlemail.com>
Date: Wed, 25 Jun 2008 01:03:29 -0700
Local: Wed, Jun 25 2008 4:03 am
Subject: 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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Seehart  
View profile  
 More options Jun 25 2008, 4:34 am
Newsgroups: comp.lang.python
From: Ken Seehart <k...@seehart.com>
Date: Wed, 25 Jun 2008 01:34:21 -0700
Local: Wed, Jun 25 2008 4:34 am
Subject: Re: automatically import modules upon interpreter invocation
Daniel Fetchinson wrote:
> 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

environment variable PYTHONSTARTUP can be set to a python file that runs
when you start the python interpreter

- Ken


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Fetchinson  
View profile  
 More options Jun 25 2008, 4:44 am
Newsgroups: comp.lang.python
From: "Daniel Fetchinson" <fetchin...@googlemail.com>
Date: Wed, 25 Jun 2008 01:44:16 -0700
Local: Wed, Jun 25 2008 4:44 am
Subject: Re: automatically import modules upon interpreter invocation

Great, thanks!

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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeffrey Froman  
View profile  
 More options Jun 26 2008, 11:42 am
Newsgroups: comp.lang.python
From: Jeffrey Froman <jeff...@fro.man>
Date: Thu, 26 Jun 2008 08:42:46 -0700
Local: Thurs, Jun 26 2008 11:42 am
Subject: 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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google