-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageT.py
More file actions
37 lines (27 loc) · 699 Bytes
/
Copy pathImageT.py
File metadata and controls
37 lines (27 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import pyautogui
import os
import time
import win32gui
def FindW():
handle=win32gui.FindWindow(0,"雷電模擬器")
if handle == 0:
return None
else:
return win32gui.GetWindowRect(handle)
ProjectPath=os.path.dirname(os.path.abspath(__file__))
print('Project >>',ProjectPath)
print("5秒後開始")
time.sleep(5)
E=pyautogui.screenshot()
File_Root=os.path.join(ProjectPath,"Test","TR.png")
E.save(File_Root)
print(File_Root)
# 以下部分是使用到easyocr的部分
# import easyocr
# EOCR=easyocr.Reader(['ch_tra'],gpu=False)
# result=EOCR.readtext(f"{ProjectPath}\\TR.png")
# print(result)
#while True:
#print(FindW())
# time.sleep(0.5)
#print(result)