UnicodeEncodeError ( 'ascii' codec can't encode character u'\ue021' in position 0: ordinal not in range(128) ) this error is killing me
import os
import sys
# 수정된 코드
#from org.sikuli.script import Key, Pattern
from org.sikuli.script import Key, Pattern, Sikulix
###실행 스크립트 부분(자동으로 검사검수를 요청해주는 프로그램)
running = True
while running:
# 대기 상태에서 Ctrl+Q, Ctrl+W, Ctrl+E 키 이벤트를 기다림
trigger_
# 트리거 키 이벤트에서 키 코드를 얻음
trigger_key = trigger_
# 검사검수 자동 요청하기(품의자에게)
if trigger_key == ord('q') + ord('A') - 1:
a = Pattern(
click(a)
type("a", Key.CTRL)
type("c", Key.CTRL)
b = Pattern(
click(b)
type("a", Key.CTRL)
type("v", Key.CTRL)
c = Pattern(
click(c)
d = Pattern(
click(d)
wait(3)
e = Pattern(
click(e)
wait(3)
f = Pattern(
click(f)
# 검사검수 내가 그냥 해버리기
elif trigger_key == ord('W') + ord('A') - 1:
# 여기에서 Do 모듈을 사용하고 있습니다. (아래 부분이 do 모듈 사용 부분)
click(a)
type("a", Key.CTRL)
type("c", Key.CTRL)
click(b)
type("a", Key.CTRL)
type("v", Key.CTRL)
click(c)
click(f)
wait(3)
g = Pattern(
click(g)
type("a", Key.CTRL)
type("v", Key.CTRL)
h = Pattern(
click(h)
wait(3)
i = Pattern(
click(i)
# 자동으로 결재하기
elif trigger_key == ord('e') + ord('A') - 1:
j = Pattern(
click(j)
wait(3)
k = "k.png"
click(k)
wait(3)
l = Pattern(
click(l)
wait(3)
m = Pattern(
click(m)
# 스크립트 실행 종료 후 대기 상태
Sikulix.
# 다시 트리거 키가 입력되면 실행되도록 함
if trigger_key in [ord('Q'), ord('W'), ord('E')]: # Ctrl+Q, Ctrl+W, Ctrl+E에 대한 키 코드
running = False
[error] script [ fuck2 ] stopped with error in line 15
[error] UnicodeEncodeError ( 'ascii' codec can't encode character u'\ue021' in position 0: ordinal not in range(128) )
[error] --- Traceback --- error source first
line: module ( function ) statement
15: main ( <module> ) trigger_key_event = Sikulix.
[error] --- Traceback --- end --------------
I am a suffered novice
I don't know what's wrong with this script.
it's killing me
p.s. eng is not my first language. so please forgive my bruteness
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: