[python-win32] EasyDialogs - how to set initial path
John Machin
sjmachin at lexicon.net
Thu Jun 30 13:29:23 CEST 2005
Radovan Grznarik wrote:
>Hi,
>
>I am using EasyDialogs (AskFileForOpen) and I am not able to set the
>initial open path. I found in Python help
>
Python help describes the *Mac* version; EasyDialogs for Windows by
Jimmy Retzlaff has slightly different arguments; there is a readme.txt
in .....\site-packages\EasyDialogs -- take a hint :-)
> that it should be 3rd
>parameter,
>
*should* be [you reading this, Jimmy???]. Here's another hint - this is
_open source_ software, Luke :-)
> then I tried this
>
>filename = EasyDialogs.AskFileForOpen("title","*.*","d:\\")
>
>but it does not work, and opens dialog in actual directory of running script.
>
>os.chdir("d:\\") before AskFileForOpen also does not work.
>
>
It works, it just doesn't do what you think it should do. WinDOS has a
current directory on *each* drive. Fire up a DOS box, unless you've
meddled, the prompt will show C:\something> ... this means the current
drive is C: and the current directory on C: is \something. If you type
cd d:\, this sets the current directory on D: to \, but you'll notice
that your prompt hasn't changed.
>Does anybody have some idea to solve this situation?
>
>
Yeah. two ideas, actually:
ONE:
try:
rtfs()
except NoSourceError:
trashthesucker()
TWO:
Keyword arguments are a thing of beauty and a joy forever, even when
they're in camelCase -- so bloody well stop counting arguments and use
them!!
>I would be grateful.
>
>Radovan Grznarik
>
>
>
More information about the Python-win32
mailing list