Hi all, I have been poking wx document and also google but i havent prevailed. All I need is to get all drives C, D, E etc just like my computer is. What is the trick? Thanks
Dirdialog may be what you are looking for.
import wx class MyFrame(wx.Frame): '''Info abot class | Doc string''' def __init__(self, parent, mytitle, mysize): wx.Frame.__init__(self, parent, wx.ID_ANY, mytitle, size=mysize) self.SetBackgroundColour('light blue') self.panel = wx.Panel(self) b = wx.Button(self.panel,-1,"Create and Show a DirDialog", (50,50)) self.Bind(wx.EVT_BUTTON, self.OnButton, b) def OnButton(self, evt): dlg = wx.DirDialog(self, "Choose a directory:", style=wx.DD_DEFAULT_STYLE #| wx.DD_DIR_MUST_EXIST #| wx.DD_CHANGE_DIR ) if dlg.ShowModal() == wx.ID_OK: self.log.WriteText('You selected: %s\n' % dlg.GetPath()) dlg.Destroy() if __name__ == "__main__": app = wx.App() mytitle = 'My window' width = 300 height = 200 MyFrame(None, mytitle, (width, height)).Show() app.MainLoop()
Edited 6 Years Ago by snippsat: n/a
Thanks Snippsat for good code but what I'm looking for is the way to get Drives without dialog just as you get files within a folder without a dialog. I want to get all available Drives and know if the drive is USB or CD or HDD
something like this:
Thanks for reply
Are you able to help answer this sponsored question?
Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies.
i am using visual studio 2015 and trying to export data which i am importing through excel by the user selected Excel file. Now the importing part has been successfully completed i am using OLEDB Connection but Stuck in exporting the same data to a new Excel file. tried ...
I am creating a program that when you print an author, you must show all the information of all the books that the author has written. Add a new attribute in the Author class that will be "BooksWriting: List (Book)".
I have expanded the program so that it also ...
I am currently creating a simulation of a pizza ordering system in object oriented program. I have some question. the instruction and guideline is long but I will try and cut it down a lot. the instruction is to create a program that simulate a pizza restaurant using ...