Blank log file
Asked by
William Elmer
Hello! I am new to jython but moderate programmer. I am trying to write to a file for someone to see whether or not the test passed. But I get a blank write.txt file back. So here is generic code.
f = open(my_dir + 'read.txt', 'r')
#do work
username = f.readline()
password = f.readline()
f.close
w = open(my_dir + 'write.txt", 'w')
w.write("username was " + username)
#some more work
w.close()
sleep(5)
# script ends here.
Experimented with w.flush and everything and nothing seems to work.
edit:
For clarity purposes, I wanted to stress : It reads great! But when I try to write it fails every time.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
To post a message you must log in.