Not able to read from text file when timestamp is used
Dear,
I have one text file "Time.txt" which contents data like:
18, 50, 50
19, 25, 56
Then I have write script in which I want take the data from text file line by line.
wait(2)
import array
arr=[]
f=open(
fout = open("D:
for line in f.readlines():
arr.
f.close()
wait(2)
click("
wait(1)
# For clock in for Employee E3
type("D:
wait(1)
type(Key.ENTER)
wait(1)
type('a', KeyModifier.CTRL)
type('c', KeyModifier.CTRL)
type(Key.F4, KeyModifier.ALT)
wait(1)
# Open firefox
click("
wait(5)
click("
type("firefox" + Key.ENTER)
wait(5)
type("t", KeyModifier.CTRL)
wait(5)
type("http://
wait("RequestXM
type(Key.TAB + Key.TAB)
type('v', KeyModifier.CTRL)
wait(2)
until = list(time.
until[3:6] = (arr[0]) # hour minute second
timeUntil = time.mktime(
timeToWait = int(timeUntil - time.time())
wait (timeToWait)
click("
wait(2)
click("
wait(2)
# For clock in for Employee E6
click("
wait(1)
type("D:
wait(1)
type(Key.ENTER)
wait(1)
type('a', KeyModifier.CTRL)
type('c', KeyModifier.CTRL)
type(Key.F4, KeyModifier.ALT)
wait(2)
click("
type('v', KeyModifier.CTRL)
wait(2)
until = list(time.
until[3:6] = (arr[1]) # hour minute second
timeUntil = time.mktime(
timeToWait = int(timeUntil - time.time())
wait (timeToWait)
click("
wait(2)
click("
wait(2)
Error occurs as:
[log] CLICK on (28,748)
[log] TYPE "D:\DPTT_
[log] TYPE " "
[log] Ctrl+TYPE "a"
[log] Ctrl+TYPE "c"
[log] Alt+TYPE "?"
[log] CLICK on (28,748)
[log] CLICK on (101,695)
[log] TYPE "firefox "
[log] Ctrl+TYPE "t"
[log] TYPE "http://
[log] TYPE " "
[log] Ctrl+TYPE "v"
[error] Stopped
[error] An error occurs at line 37
[error] Error message: Traceback (most recent call last):
File "C:\Users\
timeUntil = time.mktime(
OverflowError: an integer is required
But when I have tried by writing :
from until[3:6] = (arr[0]) # hour minute second
To until[3:6] = (18, 30, 56) # hour minute second
Then it works.
But I don't know why it was not picking value from text file.
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: