directory path access

Y

Yong Wang

Hi, all:
In my memmory, there is a system command to display all directory paths the python program has accessed.
What is command format ? I only remember use sys.path.append or insert to add the path.
Thanks a lot.

Yong
 
C

Christopher T King

In my memmory, there is a system command to display all directory
paths the python program has accessed. What is command format ?

I don't think there is any way to find which paths have been accessed,
but...
I only remember use sys.path.append or insert to add the path.

sys.path is a list containing all paths in which Python will look for
modules; dunno if this helps though.
 
P

Peter Hansen

Yong said:
In my memmory, there is a system command to display all directory paths the python program has accessed.
What is command format ? I only remember use sys.path.append or insert to add the path.

Do you just mean this?

import sys
print sys.path

Thats not a "command", per se, it's just displaying the current value
of the internal path that Python uses to find modules for import.

sys.path is a list, and that's why sys.path.append() is used to add
to it.

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,666
Latest member
selsetu

Latest Threads

Top