New question #295370 on Sikuli:
https://answers.launchpad.net/sikuli/+question/295370
I want to edit several text files in a directory and want to open them in
Notepad (windows) type some text and close them.
First I get the files in the directory to process them one by one
import os
dir = "C:/Users/win7/Desktop/textfiles"
for e in os.listdir(dir):
fileName = os.path.join(dir, e)
print fileName
print "all files processed"
this outputs the following:
C:/Users/win7/Desktop/textfiles\1.txt
C:/Users/win7/Desktop/textfiles\2.txt
C:/Users/win7/Desktop/textfiles\3.txt
C:/Users/win7/Desktop/textfiles\4.txt
C:/Users/win7/Desktop/textfiles\5.txt
all files processed
So the variable fileName contains the complete path to the file I want to edit.
How do I use the App.open command to open notepad with that file?
I tried:
App.open ("notepad" fileName)
but that gives:
[error] script [ Naamloos ] stopped with error in line 6 at column 24
[error] SyntaxError ( "no viable alternative at input 'fileName'", )
Then I tried
App.open ("notepad fileName")
now notepad starts but complains it can not find the file fileName.txt
I tried several variations with ' and " and commas but none works. Is this
possible and if so how should it be done?
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.
_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help : https://help.launchpad.net/ListHelp