473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
Jun 27 '08 #1
1 994
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
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Csaba Henk | last post by:
Hello! I use Python 2.2.2 on Linux. I met the following issue: Say I have the module mymod and the script myprog.py in /mydir. myprog.py imports mymod. If I create a symlink /foo/myprog2.py...
0
by: Vio | last post by:
Hi, I've been trying to embed (statically) wxPy alongside an embedded py interpreter on a linux/gtk box. At one point, for some reason misc.o linking reported "multiple definitions of...
4
by: Steve Holden | last post by:
I'm trying to load module code from a database, which stores for each module its full name, code, load date and a Boolean indicating whether it's a package or not. The following simple program:...
3
by: Olivier Noblanc ATOUSOFT | last post by:
Hello, When i want to import a .py fire from another subdirectory i make import inc/setupxml but that make me an error message.
11
by: Connelly Barnes | last post by:
Hi, I wrote the 'autoimp' module , which allows you to import lazy modules: from autoimp import * (Import lazy wrapper objects around all modules; "lazy modules" will turn into normal...
17
by: mohan | last post by:
Hi Guys, I've been using the following IDE, "Pythonwin - Python IDE and GUI Framework for Windows. Copyright 1994-2001 Mark Hammond " With respect to my work, I had created my own modules...
49
by: Martin Unsal | last post by:
I'm using Python for what is becoming a sizeable project and I'm already running into problems organizing code and importing packages. I feel like the Python package system, in particular the...
1
by: Adam Atlas | last post by:
What is the best way for a Python process (presumed to be a script run by the interpreter binary, not embedded in some other program) to restart itself? This is what I've been trying: import...
0
by: Ken Seehart | last post by:
Daniel Fetchinson wrote: environment variable PYTHONSTARTUP can be set to a python file that runs when you start the python interpreter - Ken
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.