← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #185801]: Start a file on Windows with its preferred application --- use os.popen()

 

Question #185801 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/185801

Description changed to:
***** solution

import os

# either
cmd = r'"C:\Documents and Settings\myuser\Mes documents\test3.pdf"'

# or
cmd = r'start /D "C:\Documents and Settings\myuser\Mes documents" test3.pdf'

# and
os.popen(cmd)

(using the start command (2nd version) is preferable if you need one of
its options)

-----------------------------------------------------------------------------------------------------------------------

Im am trying to use the python os.startfile("myfile.pdf") function to
open a file. It's supposed to be available since Python 2.0. Using
Sikuli X-1.0rc2, there should be no problem. But the function isn't
available.

Does anybody has an idea about a way to open such a file using system
default application ?

Thank you a lot for your help,

Sylvain

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.