Skip to main content

자동화를 위한 패키지

Project description

PyAutoMaker


자동화를 위한 파이썬 패키지
개발중인 버전이며 내보낸 API는 언제든지 변경될 수 있습니다

설치방법


PyPI package에서 설치하는 방법

pip install PyAutoMaker -U

또는 저장소에서 클론하는 방법

git clone https://github.com/boa9448/PyAutoMaker
cd PyAutoMaker
python setup.py install

사용방법


특정 이름을 가진 창의 핸들을 구하는 방법

import PyAutoMaker as pam

handle_list : list[int] = pam.utils.get_window_handle("제목 없음 - Windows 메모장")

데스크탑 스크린샷을 찍는 방법

import cv2

import PyAutoMaker as pam

#화면 스크린샷
img = pam.image.desktop_screenshot()
cv2.imshow("desktop_screenshot", img)
cv2.waitKey()
cv2.destroyAllWindows()

특정 이름을 가진 창의 스크린샷을 찍는 방법

import cv2

import PyAutoMaker as pam

#화면 스크린샷
img = pam.image.screenshotEx("MapleStory", rect = (0, 0, 500, 500))
cv2.imshow("screenshotEx", img)
cv2.waitKey()
cv2.destroyAllWindows()

화면에서 이미지서치를 사용하는 방법

import cv2

import PyAutoMaker as pam

src = pam.image.desktop_screenshot()
temp = cv2.imread("temp.png")
result = pam.imageSearchEx(src, temp)

for left, top, right, bottom in result:
    cv2.rectangle(src, (left, top), (right, bottom), (0, 255, 0), 2)

cv2.imshow("view", src)
cv2.waitKey()
cv2.destroyAllWindows()

아두이노를 사용해서 키보드 마우스를 입력하는 방법

import PyAutoMaker as pam

#펌웨어는 처음 한번만 업로드 하세요
#pam.arduino.upload()

arduino = pam.arduino.ArduinoUtil(pam.arduino.user_select_port(), 115200)

#A 입력
arduino.key_press(ord("A"))
arduino.key_release(ord("A"))

#컨트롤 키 입력
arduino.key_press(pam.input.KEY_LEFT_CTRL)
arduino.key_release(pam.input.KEY_LEFT_CTRL)

#100, 100좌표로 이동
arduino.move(100, 100, False)

#현재 좌표에서 100, 100만큼 이동
arduino.move(100, 100, True)


#마우스 좌클릭
arduino.btn_press(pam.input.BUTTON_LEFT)
arduino.btn_release(pam.input.BUTTON_LEFT)

class dd를 사용해서 키보드 마우스를 입력하는 방법

import PyAutoMaker as pam

dd = pam.class_dd.DDUtil()

#A 입력
dd.key_press(ord("A"))
dd.key_release(ord("A"))

#100, 100좌표로 이동
dd.move(100, 100, False)

#현재 좌표에서 100, 100만큼 이동
dd.move(100, 100, True)

#마우스 좌클릭
dd.btn_press(pam.input.BUTTON_LEFT)
dd.btn_release(pam.input.BUTTON_LEFT)

또는...

import PyAutoMaker as pam

#아두이노를 사용할 때는 펌웨어를 처음 한번만 업로드 하세요
#pam.arduino.upload()

#아두이노 사용
input_ = pam.input.InputUtil(pam.input.DDUtil, tuple())

#또는 class dd사용
#input_ = pam.input.InputUtil(pam.input., (pam.arduino.user_select_port(), 115200))

#A 입력
input_.key_press(ord("A"))
input_.key_release(ord("A"))

#컨트롤 키 입력
input_.key_press(pam.input.KEY_LEFT_CTRL)
input_.key_release(pam.input.KEY_LEFT_CTRL)

#100, 100좌표로 이동
input_.move(100, 100, False)

#현재 좌표에서 100, 100만큼 이동
input_.move(100, 100, True)


#마우스 좌클릭
input_.btn_press(pam.input.BUTTON_LEFT)
input_.btn_release(pam.input.BUTTON_LEFT)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyAutoMaker-0.3.0.tar.gz (30.5 MB view details)

Uploaded Source

Built Distribution

PyAutoMaker-0.3.0-py3-none-any.whl (30.6 MB view details)

Uploaded Python 3

File details

Details for the file PyAutoMaker-0.3.0.tar.gz.

File metadata

  • Download URL: PyAutoMaker-0.3.0.tar.gz
  • Upload date:
  • Size: 30.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.7

File hashes

Hashes for PyAutoMaker-0.3.0.tar.gz
Algorithm Hash digest
SHA256 392beda76adde5b50d31aced57e1d0d39356e1e69eb67913a846f0dfcad37137
MD5 815aaf8ecb5bd3108ac26ed7af792f6c
BLAKE2b-256 9cefe654025d43afa2a023b97d00d0b0d85f544a97a4a71cf4e557eead29f138

See more details on using hashes here.

File details

Details for the file PyAutoMaker-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: PyAutoMaker-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.7

File hashes

Hashes for PyAutoMaker-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01dfa57eb281da1e7b1dae1fbb901ca0ad6b0324e024cb01017d5c4718ebe8e1
MD5 70cb818fed80c3a6073f4be6c3a40cb6
BLAKE2b-256 c0a12c668a39d1ac93934de2586d6efa902538f1f7a64423c15a879a22219213

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page