Dumb Newbie Question

Clarence Gardner clarence at netlojix.com
Sat Dec 9 18:33:35 EST 2000


On Sat, 09 Dec 2000, Scott Weisel wrote:
>I thought I might be able to modify sys.path like this
>sys.path = sys.path + "c:\\python16\\programs 
>but I'm getting a TypeError stating "illegal argument type for built-in
>operation."

sys.path is a list -- you can join lists together with '+' like you
tried, but not a list and a string, so you want:
    sys.path = sys.path + ["c:\\python16\\programs"]

Note that, being an assignment statement, sys.path will refer to
a different object after this statement than before it.  You can also
add your element to the end of the existing list with
    sys.path.append("c:\\python16\\programs")




More information about the Python-list mailing list