the current working directory

Asked by victor n. on 2010-02-21

hello,

the program worked fine on my windows xp machine. kudos!!

now, how do i tell the program what the folder to use as current folder? i usually execute python interactive interpreter in my development folder so i can directly import modules.

thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
DreamPie Edit question
Assignee:
No assignee Edit question
Last query:
2010-02-21
Last reply:
2010-03-04

import os
os.chdir('DIR_PATH')

This will change the current working directory to whatever string you put in DIR_PATH. To see what the current working directory is use:

os.getcwd()

victor n. (noagbodjivictor) said : #2

thanks for you answer molesupermole.

i was using something similar. but i still think of this initial setup as a bother. maybe there is a command line argument to change the current dir?

Wendell (wackywendell) said : #3

You can put that code in Preferences -> Shell -> execute code on startup

Noam Yorav-Raphael (noamraph) said : #4

You can also start dreampie from the working directory you're working at - something like:
c:\dir> "\program files\dreampie\dreampie.exe"

Or if you add \program files\dreampie to your %path% variable, that would be just
c:\dir> dreampie

Can you help with this problem?

Provide an answer of your own, or ask victor n. for more information if necessary.

To post a message you must log in.