[Tutor] Configure Problems

Snoopy :-)) genius@idirect.com
Wed, 15 Mar 2000 15:22:23 -0500


Hi Alan.
Thanks for the reply and the "welcome message".
Aam I correct in the Understanding, that the two Paths which you are
talking about are the
PATH & PYTHONPATH.  and ,that they Should be setup in
/home/.bash-profile File ??

BTY.  I am also studying Your-Tutorial and find it very helpful.  It's
somehow easier to understand than the book "Learning Python".  I guess i
have a long way to go yet.  So back to the "Salt-Mine".
Best regards;
Charles :-))

alan.gauld@bt.com wrote:

> > I am a Newbie with Linux as well as Programming.
>
> Welcome to the funny farm :-)
>
> > but things are not as they supposed to be.  The problems seem
> > to be in configuring to use "Module Files and Script Files.
> > I would really appreciate some helping hand.
>
> You need to set two paths in your shell login files.
>
> Your normal unix path needs to be set to include
> your python project directory. This will allow you
> to execute your programs from abnywhere on the system.
>
> You need to set the PYTHONPATH environment variable
> to include your directory. This will allow python
> to find your modules from anyewhere on the system.
> eg if you fire up the >>> prompt.
>
> > Then chmod +x myfile.py
> > could only be donw when I changed to the /home/charly/Mydir
>
> Or if you gave the full path to your file...
>
> > The following problem seem to occur.
> > 1.  To run the file at the "Shell promt" (as a shell script)
> >     a.   I can only do it if first I cd to the files
>
> That should be ficxed by adding your directory to the
> unix PATH.
>
> try
> $ env|grep PATH
>
> to see if it has been set correctly
>
> >     b.   I must also add the .py file extension
>
> You shouldn't need to if the #! /usr/bin/python
> is set correctly
>
> > 2.  If I am not in the Subdirectory /home/charly/Mydir when I
> > run python (in xterm)
> > import myfile
> >          then python gives en error.
>
> That needs the PYTHONPATH fix.
>
> > I was my understanding that Python would find a .py extension
> > file regardless of in which directory it is.
>
> Nope, you need to tell it.
>
> > understanding, that if a Path is put into the
> > bash_profile file the the shell would find it and it is not
>
> You need to add it to the PATH variable,
> I assume - I use tcsh myself!
>
> Alan G.