8
창에서 작동하지 않습니다 :.sendto() 메소드는이 코드를 사용하는 나는 창문에 sikuli 파이썬 스크립트를 개발
from socket import AF_INET, SOCK_DGRAM
import sys
import socket
import struct, time
host = "pool.ntp.org"
port = 123
buf = 1024
address = (host,port)
msg = '\x1b' + 47 * '\0'
# reference time (in seconds since 1900-01-01 00:00:00)
TIME1970 = 2208988800L # 1970-01-01 00:00:00
# connect to server
client = socket.socket(AF_INET, SOCK_DGRAM)
client.sendto(msg, address)
msg, address = client.recvfrom(buf)
t = struct.unpack("!12I", msg)[10]
t -= TIME1970
current_time = time.ctime(t).replace(" "," ")
코드는 리눅스에서 나에 파이썬 스크립트에서 잘 작동
[error] script [ Sikuli_Test_Original ] stopped with error in line 23
[error] _socket.error ([Errno -1] Unmapped exception: java.util.concurrent.RejectedExecutionException: event executor terminated)
[error] --- Traceback --- error source first line: module (function) statement 359: _socket (handle_exception) _socket.error: [Errno -1] Unmapped exception: java.util.concurrent.RejectedExecutionException: event executor terminated
995: _socket (sendto) File "C:\Users\myuser\Documents\Sikuli\sikulix.jar\Lib\_socket.py", line 971, in _datagram_connect
[error] --- Traceback --- end --------------
어떤 생각을 왜 그것을 해결하는 방법 : 나는 창문에 sikulix에이 코드를 사용하는 경우 윈도우는하지만, 다음과 같은 오류와 (줄에서 =>client.sendto (MSG, 주소)) 충돌 ?
나는 하나 – user3472065
당신이 같은 sikuli 버전에 사용하고 sikuli가 자신의 _socket.py를 사용하려고 인상이 아닌 시스템을했다 두 시스템? –
예, 최신 버전의 sikulix – user3472065