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()
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
Isn't it about time forums rewarded their contributors?
Contribute to this discussion and earn rewards points that can be cashed out for dollars.
i am trying to create a library management system which is supposed to be used to store/keep infp for the library and the library members( book title, author, name and picture for borrower and other stuffs). The app has 6 buttons, delete, save, add,previsous,next, and upload( for upload ...
Im trying to bind my custom vertical scrollbar to datagridview is this possible.. Please help Thnak you..
I have two tables, I will call them first-half and second-half (of the year)
Table: first id jan feb mar apr ----------------------- 2 80 90 70 60 3 50 40 60 30 Table: second id jan feb mar apr ----------------------- 2 50 70 60 90 3 80 60 50 ...