Not able to close the text file in main script when opened in def()
Hi,
I want to write the text file when I have used array.
It was giving me error as :
my_file.close()
NameError: name 'my_file' is not defined
=======
Check the code:
# Game ended
def Employee(event):
wait(1)
click(
wait(1)
type(
wait(1)
el = "\n" # the end of line you want to use
my_
if exists ("ULUNPAID-7.png"):
type("UL")
wait(2)
if exists ("WOWEEKLYOFF-
type("WO")
wait(2)
wait(1)
# Main function
# Go to Portal for checking Employee Attendance report
import array
DPRead=[]
f=open(
fout = open("D:
for line in f.readlines():
DPRead.
f.close()
wait(2)
click("
wait(5)
click("
type("firefox" + Key.ENTER)
wait(5)
type("t", KeyModifier.CTRL)
wait(10)
type("https:/
wait("LoginUser
click("
type("ABCD")
click("
type("1234")
wait(2)
# Employee code for E1 : abhileft1
wait(2)
SCREEN.
onAppear(
observe(50)
wait(1)
# Employee code for E1 : abhileft2
click("
wait(2)
SCREEN.
onAppear(
observe(50)
my_file.close() # ERROR OCCURS AT THIS STAGE
wait(2)
App.close(
wait(3)
Please do needful help.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: