win32api

Asked by Linus Holmeros

Hi,

I would like to open long file (.txt) after my test with its default app in windows..

I´ve found a script wich needs win32api to work.. is there another way or how do I get win32api to work with sikuli?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Harry Readinger (temporary22) said :
#1

I dont know anything about getting win32api to work, but worst case scenario you could go to that file using Explorer and just double click on the icon.

There is probably a better way but that will guarantee that it opens with the default program. I'm going to think on this more and see if i come up with a better solution

Revision history for this message
RaiMan (raimund-hocke) said :
#2

this works in Win7

import os
dir = r"c:\folder\subfolder" # the directory containing the text file
fname = "logging.txt" # the filename of the text file
os.popen("start /D %s %s"%(dir, fname)) # using the start command
# which opens the program that is associated with the extension (.txt in this case)

Can you help with this problem?

Provide an answer of your own, or ask Linus Holmeros for more information if necessary.

To post a message you must log in.