Disk explorer from python with COM

Roger Upole rupole at hotmail.com
Thu Nov 8 07:49:33 EST 2001


Don't know if this is exactly what you want, but it opens a standard
Windows browse for file dialog.

import win32com.client
dlg = win32com.client.Dispatch('{F9043C85-F6F2-101A-A3C9-08002B2F49FB}')

def getfile(initdir,initfilename,mustexist=0,dlgtitle=''):
    dlg.DialogTitle=dlgtitle
    dlg.MaxFileSize=256
    dlg.InitDir=initdir
    dlg.FileName=initfilename
    if mustexist:
        dlg.Flags=0x1000 ####cdlOFNFileMustExist
    else:
        dlg.Flags=0

    dlg.ShowOpen()
    return dlg.FileName

HTH
   Roger Upole

"Benoit Lagrange" <blagrang at ulb.ac.be> wrote in message
news:3BE91448.5020809 at ulb.ac.be...
> Hi all
> I am wondering wether it is possible to browse the disk from a python
> application by using COM.
> And if it is possible, how to use it?
> Any help would be great.
> Thanks
>
> Benoit Lagrange
>


______________________________________________________________________________
Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net



More information about the Python-list mailing list