sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #09223
[Question #189936]: In Sikuli r930, how to trigger a commad, such as "Ping" ?
New question #189936 on Sikuli:
https://answers.launchpad.net/sikuli/+question/189936
Hi, Sir,
In Sikuli r905 version,
I can trigger a "ping" command through os.systm("Ping www.google.com > test.log")
It works fine to record the ping result in a file.
However, in the latest version r930,
the sikuli always show an type error: "TypeError: unsupported operand type(s) for +: 'NoneType' and 'list"
Do I have any chance to use command in Sikuli r930 version?
I also attach the source code and error message in the following.
Thnaks in advance.
~~~~~~~~~~~~~~~~~~~~~~~
Sample Source Code:
=================================
import os
import sys
import time
#need to create the file in the corresponding path
My_Log_File = "C:\Log\MyTest.log"
Ping_IP = "www.google.com"
if os.path.exists(My_Log_File):
os.remove(My_Log_File)
time.sleep (3)
os.system("ping "+ Ping_IP + ">" + My_Log_File)
time.sleep (3)
log_file = open(My_Log_File, "a+")
log_file.write("=====Test=====\n")
log_file.close()
=====================================
Error message in r930:
------------------------------------------------------------
[info] Sikuli vision engine loaded.
[info] Windows utilities loaded.
[info] VDictProxy loaded.
[error] Stopped
[error] An error occurs at line 13
[error] Error message: Traceback (most recent call last):
File "C:\Users\pegatron\AppData\Local\Temp\sikuli-tmp8426656929974300277.py", line 13, in
os.system("ping "+ Ping_IP + ">" + My_Log_File)
File "C:\win8\Sikuli-r930-win32\Sikuli-r930-win32\Sikuli-IDE\sikuli-script.jar\Lib\subprocess.py", line 456, in call
File "C:\win8\Sikuli-r930-win32\Sikuli-r930-win32\Sikuli-IDE\sikuli-script.jar\Lib\subprocess.py", line 751, in __init__
File "C:\win8\Sikuli-r930-win32\Sikuli-r930-win32\Sikuli-IDE\sikuli-script.jar\Lib\subprocess.py", line 1236, in _execute_child
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
---------------------------------------------------------------------
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.