[wxPython-users] How to show PDF
hawk gao
gaohawk at gmail.com
Sun Mar 9 10:19:34 PDT 2008
import os
if os.name=='posix':
#cmd = "xdg-open '%s' &"
cmd = os.popen('''which op xdg-open exo-open gnome-open kfmclient
open | head -n1 | sed "s/$/ '%s' \&/; s/kfmclient/kfmclient exec/"
''').read()
elif os.name=='nt':
cmd = 'start %s'
def opendoc(filename):
os.popen(cmd%filename)
2008/3/9, hawk gao <gaohawk at gmail.com>:
> I know 4 ways.but, i'm not sure all of them can run. you can just try them.
>
> 1.module mailcap
> 2.http://pypi.python.org/pypi/desktop
> 3.
> os.spawnvp(os.P_WAIT, "run-mailcap", ["run-mailcap", name])
> 4.
> import os
> if os.name == 'posix':
> def startfile(name):
> os.system('run-mailcap "%s"' % name)
> os.startfile = startfile
>
> Enjoy it!
>
> 2008/3/4, Algirdas Brazas <lists at digital.ktu.lt>:
>
> > Sorry for posting it again - never mind it :)
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> > For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
> >
> >
>
More information about the wxpython-users
mailing list