Python Path

Steve Holden sholden at holdenweb.com
Wed Aug 30 21:56:34 EDT 2000


Poparosa wrote:
> 
> I appreciate the help here, but I a stuck in a similar problem, and I can't
> find any *.pth files to append to, nor can I get the
> sys.append('c:/mysqlgui/piddle') call to work.
> 
The original advice you were given had not been tested.  What you
(appear to) need to do is add another directory to the sys.path
variable.  So you'll need something like this:

import sys
sys.path.append(r"C:\mysqlgui\piddle")

> What is the syntax of the append call (what does it want as a formal
> parameter?)
> I get the following message:
> Traceback(innermost last):
>   File "<stdin>", line 1, in ?
> AttributeError: append
> 
The point is that "append" is a method of the built-in list type,
so you use it to qualify the list object you want to append to, using
the item you want to append as an argument.

> On another thread, how can I create a file with a .pth extension (notepad
> always appends .txt)?
> 
Not a Notepad user.  Idle is actually a reasonable editor for stuff like
this.  It comes as a part of the standard Windoze distribution, and will
save files with any extension you like.

> thanks

A pleasure.

Steve Holden
-- 
Helping people meet their information needs with training and technology.
703 967 0887      sholden at bellatlantic.net      http://www.holdenweb.com/



More information about the Python-list mailing list