mod_python and files directory

M

mete bilgin

Hi all,
I try to make a websevice with python and mod_python. Ä° try to make a po
files, but i can not reach them in the page. When i ask the page like "
os.listdir('.') " but i want to get files directory, what can i do? sorry
for my bad describe of that. Thanks a lot...
 
G

Graham Dumpleton

Hi all,
I try to make a websevice with python and mod_python. Ý try to make a po
files, but i can not reach them in the page. When i ask the page like "
os.listdir('.') " but i want to get files directory, what can i do? sorry
for my bad describe of that. Thanks a lot...

The current working directory in Apache can be anything. You must
supply an absolute path to all directories/files you are trying to
access/use.

Graham
 
M

mete

but i want to take it somewhere else...i want to it work some other path in
other system.
 
G

Gabriel Genellina

but i want to take it somewhere else...i want to it work some other path
in
other system.

os.path.dirname(os.path.abspath(__file__))
returns the directory where the current file resides. Execute it early in
your code.
 
G

Gabriel Genellina

but i want to take it somewhere else...i want to it work some other path
in
other system.

os.path.dirname(os.path.abspath(__file__))
returns the directory where the current file resides. Execute it early in
your code.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top