os.startfile on Mac?

I have this bit of code which launches a PDF help file just fine on Windows, but doesn’t work on Macs. The files are there but for some reason they’re not launching on Mac…any ideas? Thanks :slight_smile:

def OnHelp(self,event):

HelpFile = os.path.join(AltDocumentsFolder,‘VueToolsManual.pdf’)
if os.path.exists(HelpFile) == 0:
# PDF NOT THERE
tMsg = “VueToolsManual.pdf not found!\n” + tScriptPath

  wx.MessageBox(tMsg,"Error",wx.OK|wx.ICON_INFORMATION,self)

else:
# PDF FOUND
os.startfile(HelpFile)

Chipp Walters wrote:

I have this bit of code which launches a PDF help file just fine on Windows, but doesn't work on Macs. The files are there but for some reason they're not launching on Mac..any ideas? Thanks :slight_smile:

The equivalent to the Windows start command on Mac is open, so perhaps os.system("open VueToolsManual.pdf") would do the trick for you.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!