Thanks a lot. your posts are really helpful. On Sun, Jul 17, 2011 at 4:41 PM, Steven D'Aprano <[email protected]>wrote:
> Surya P.K. Kasturi wrote: > > can you tell me in detail how to do this. >> I am new to linux. >> > > "this" being: > > On Sat, Jul 16, 2011 at 11:48 AM, Alan Gauld <[email protected]>* >> *wrote: >> >>> You need to add the folder to your PYTHONPATH environment variable. >>> >>> You usually do this your .login or .profile file. >>> >>> Python will add the contents of PYTHONPATH to sys.path on startup. >>> >> > (Surya, on this list we prefer if people don't top-post.) > > What Alan means is for you to edit your login file so that it creates an > environment variable. How you do that depends on which shell you are using. > If you don't know which shell, try this: > > (1) Open a fresh terminal window. > (2) Type "echo $SHELL" (without the quotation marks) and press Enter. > > This will print something like this: > > > [steve@sylar ~]$ echo $SHELL > /bin/bash > > > So I am running "bash" as my shell. So I have the following line in my bash > login file, .bashrc: > > > export PYTHONPATH=/home/steve/python/ > > > That creates an environment variable, PYTHONPATH, which Python will > automatically add to sys.path. > > (Other shells will do this differently.) > > > Another alternative: I also have set a startup file: > > > export PYTHONSTARTUP=/home/steve/**python/startup.py > > > I can put any Python code I like in startup.py and it will be run just > before the interactive interpreter. > > Or you can follow Peter's advice and use a .pth file. > > > > -- > Steven > > > ______________________________**_________________ > Tutor maillist - [email protected] > To unsubscribe or change subscription options: > http://mail.python.org/**mailman/listinfo/tutor<http://mail.python.org/mailman/listinfo/tutor> >
_______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
