On Wednesday 05 December 2007 06:07:39 am Nate Lowrie wrote: > On Dec 5, 2007 2:23 AM, johnf <[EMAIL PROTECTED]> wrote: > > def _openDialog(self,evt): > > # need to receive the evt (in this case a click or Hit) > > theDialog=dabo.ui.dFileDialog(self) > > theDialog.show() > > *************DELETE********************* > > > if sys.platform == 'win32': > > myseperator = "\\" # some should post why I > > needed two slashes else: > > myseperator = "/" > > ****************DELETE******************* > > > myReturnFileValue= theDialog.FileName > > myReturnDirectory = theDialog.Directory > > > > self.filename.Value= myReturnDirectory + myseperator + > > myReturnFileValue > > Change the last line to: > > self.filename.Value = os.path.join(myReturnDirectory, myReturnFileValue) > > That is a more Pythonic fix than Uwe's... > > Cheers, > > Nate L.
Please add a full description of why that works. Folks coming from other languages know little about the os module. For example it needs to be pointed out that the os module is platform aware. Also what ".join" is doing and how it got there. From the private emails I'm getting it is obvious that the newbies know little about python. I'll add your side bar to the wiki when I post the thread and all the other sidebars. -- John Fabiani _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]
