[wxPython-users] Re: How to open an explorer window?

Chris Mellon arkanes at gmail.com
Wed Aug 1 10:54:20 PDT 2007


On 8/1/07, Robert Dailey <rcdailey at gmail.com> wrote:
> Hi,
>
> First of all I don't mean to sound unappreciative, I apologize if I have
> offended. Secondly by "unclean" I mean that you're passing in an arbitrary
> string that must be parsed; whereas all of the data components in the string
> can be split up to represent objects and/or methods. For example,
> wx.FileDialog is an interface that has members functions that do various
> tasks. Creating a explorer window using that string is like creating a
> wx.FileDialog by doing: wx.MakeDlg( "-title 'Open a file' -extensions
> '*.txt,*.cpp' -button 'ok' -button 'cancel'" ). My basic point is that I was
> expecting a more object oriented way of opening an explorer window, much
> like wx.FileDialog in comparison.
>
> wxWidgets is supposed to be platform independent, which makes this task
> difficult. I'm not an expert in any other operating system but Windows, but
> the way file explorer is interfaced through windows just seems like a very
> platform specific thing to me (other operating systems might do it
> completely differently I imagine). Secondly, your suggestion gets the job
> done in one line of code, so no point in complaining. It was my fault for
> not phrasing my previous comment correctly, I meant to say that it's
> actually clean in terms of code size, and by "unclean" I meant it's not
> object oriented.
>
> I hope I've cleared up any miscommunication. Thanks again for the wonderful
> solutions.
>

You asked how to do a platform specific task and received a platform
specific example.

More specifically, you wanted to launch a separate process with
specific arguments. There's absolutely no need for an "object
oriented" solution here and it's totally different than creating a
dialog because you are launching a platform specific utility, not
doing anything internal to your application.

If you're worried about the command line (which is valid, to an
extent) there are more complicated ways to call Popen that less you
pass the command line args separately. I'm sure you can figure those
out if you want them.




More information about the wxpython-users mailing list