how to open a folder

Asked by fani

Hello,

I just want to open a folder e.x. the following: C:\Program Files\Microsoft\Microsoft Access 2010 Interactive Guide\ClientBin
- not the folder though.

I guess there is a easy way how to do it but I couldn't find any information.

Thank you.

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
RaiMan (raimund-hocke) said :
#1

not understood.

What means: just want to open a folder ??

For what purposes?

Revision history for this message
fani (sagerer) said :
#2

to copy a file out of it.

Revision history for this message
j (j-the-k) said :
#3

Do you want to open it in python or do you want sikuli to open it?

In Python you can open a file with something like

open("C:\\Program Files\\Microsoft\\Microsoft Access 2010 Interactive Guide\\ClientBin\\xyz","r")

or if you want to copy a file

shutil("C:\\Program Files\\Microsoft\\Microsoft Access 2010 Interactive Guide\\ClientBin\\xyz", "C:\\new\\location\xyz")

If you want Sikuli to open it on the desktop, I can't see the problem, doubleclicks and some images should do.

Revision history for this message
fani (sagerer) said :
#4

I thought I might be able to prevent doing 7 doubleClick steps with Sikuli but apparently I can't.
Thanks!

Revision history for this message
j (j-the-k) said :
#6

You should defenitely do file copying like RaiMan explains it, it is a lot faster and safer than doing it with Sikuli.

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

*** rewrite of hidden comment #5, which contains errors

This can be done with Python functions:

import os
import shutil
inFile = os.path.join(some_path, some_filename)
outFile = os.path.join(some_other_path, some_filename)
shutil.copy(inFile, outFile)

the ..._path variables have to be set to an absolute path and the path's must exist.

Can you help with this problem?

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

To post a message you must log in.