A Simple python Wrapper for DM
Project description
一個使用Python封裝大漠插件的庫
這個模組是為了封裝大漠7.2213版本,並封裝了大漠插件的API,以便讓IDE都可以有代碼提示。
這些方法是從大漠插件DLL的倒出函數,生成的Python方法,因為目前沒有看到封裝比較完整python調用大漠的Libary,便有了這個。
安裝
pip install pydmsoft
功能
初始化
# 已在系統註冊大漠調用
dm = DM()
# 使用免註冊調用 只需要在第一次調用一次即可 其餘的可直接使用 dm=DM()
dm = DM(DmRegPath="path_to_dmreg.dll", DMPath="path_to_dm.dll")
導入
from pydmsoft import DM
使用範例
-
註冊
dm = DM() result = dm.Reg(code, Ver) print(result) -
OCR 辨識
dm = DM() result = dm.Ocr(0, 0, 100, 100, "ffffff-000000", 0.9) print(result) -
尋找文字
dm = DM() result = dm.FindStr(0, 0, 500, 500, "example", "ffffff-000000", 0.9) print(result) -
截圖
dm = DM() dm.Capture(0, 0, 200, 200, "screenshot.png") -
模擬鍵盤操作
dm = DM() # 按下 'A' 鍵 dm.KeyPress(65) -
部分找圖找色可使用wait_until(等待秒數,間隔)
try: print(m_dm.Reg('xxxx','xxx')) print(m_dm.FindColor(0,0,100,100,"ffffff",0.9,0).wait_until(5)) print(m_dm.FindColorE(0,0,100,100,"ffffff",0.9,0).wait_until(5)) print(m_dm.FindMultiColorE(0,0,100,100,"ffffff-000000",0.9,0,0).wait_until(10)) except TimeOutException as e: print(e)
注意事項
請確保大漠的dll檔案和註冊檔案路徑正確。另外,當使用免註冊調用時,需同時提供DmRegPath和DMPath。
開發者資訊
這是一個開源的封裝項目,歡迎貢獻及提供建議。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydmsoft-1.0.1.tar.gz.
File metadata
- Download URL: pydmsoft-1.0.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d68a993994b16d59f93c597a9fb387ec8e2dd6ef6a07d1bd63d8667541bec4d6
|
|
| MD5 |
4cf038a2253e3d302de3b905056b8758
|
|
| BLAKE2b-256 |
56da27bdfb4c0a347f9ef7d4c8abc5688c68966c0e4ba6cb86e4ca98514703b3
|
File details
Details for the file pydmsoft-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pydmsoft-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f3bff1f92d65b27e854f07842a2f75fed8135e4e0e7fd3ddd344f4609ddc8cf
|
|
| MD5 |
9331b9fb3890726d0a9f08ee212a7df8
|
|
| BLAKE2b-256 |
f7586e646caf6a2674f814388747b9781dad35bac4f2fe2d58ec74fa890aff41
|