sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #40080
Re: [Question #374925]: Editing, deleting Files
Question #374925 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/374925
Status: Open => Answered
Roman Podolyan proposed the following answer:
Okay. Here is code deleting two files in "D:\Tmp\Del" regardless of are they there or not ("try" construction does just that)
__________
import sys
# You need sys to manipulate files
try:
os.remove("D:\\Tmp\\Del\\workfile1.txt")
except:
pass
try:
os.remove("D:\\Tmp\\Del\\workfile2.txt")
except:
pass
__________
Tested under same OS and with same Sikuli as above.
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.