안녕하세요! 파이썬 처음처럼입니다.
한국거래소에서 긁어 모은 KOSPI 기업 시가총액 전체 순위 월초 자료를 공유합니다. 시가총액 순위가 기록된 1995년부터 2019년까지 월초인 해당월의 1일부터 5일까지를 긁어 모았습니다.
(한국거래소 http://marketdata.krx.co.kr/)
KOSPI 기업 시가총액 전체 순위 월초 자료 다운로드
*
개장일이 아닌 날은 제외하였습니다.
*
방대한 자료 중 아래의 날짜의 데이터는 빠져있습니다.
(20191105, 20111203, 20060704, 19970503)
*
csv파일로 구성되어있습니다.
2019년 12월 22일 일요일
2019년 12월 17일 화요일
How to implement Autohotkey's imeagesearch function in Python
Hello everyone. For Work automation, Python!
So today we will learn how to implement Autohotkey's imeagesearch functionality in Python.
First, download imagesearch.py from drov0's Github. And put imeagesearch.py in py file's path to be created.
(https://github.com/drov0/python-imagesearch)
Second, install following libraries. Run Python in the location of requirements.txt in the downloaded folder and proceed with pip3 install -r requirements.txt. The best thing to do is to install it through Anaconda and proceed with the installation of additional libraries.
Required libraries
- opencv-python
- numpy
- python3_xlib
- pyautogui
If do perfectly, preparation is completed!
Now put the image file you want to find in the path. Let's design a program that clicks on the Google logo.
As shown below, capture only a part of Google logo and put in path as google.png file.
Then write python file like below.
Explanation
line 1 from imagesearch import *: imports imagesearch.py
line 3 img = './google_logo.png': Put the path of the image file you want to find in the variable img.
line 4 pos = imagesearch (img): Find the image file and insert the mouse coordinates in the variable pos.
line 5 if pos [0]! = -1: : If pos value is normal, excute.
line 6 click_image (img, pos, 'left', 0.1): Randomly clicks pos position within img size, having a 0.1 second mouse movement time.
Through your browser, open the Google logo window that looks like the image we have, and run that py file. If you recognize the image and click on the Google logo, it's a success!
Thank you.
Korean Language Version link is
(https://pyinweb.blogspot.com/2019/04/imagesearch.html)
So today we will learn how to implement Autohotkey's imeagesearch functionality in Python.
First, download imagesearch.py from drov0's Github. And put imeagesearch.py in py file's path to be created.
(https://github.com/drov0/python-imagesearch)
Click the [Clone or download] button, You will get imagesearch.py |
Second, install following libraries. Run Python in the location of requirements.txt in the downloaded folder and proceed with pip3 install -r requirements.txt. The best thing to do is to install it through Anaconda and proceed with the installation of additional libraries.
Required libraries
- opencv-python
- numpy
- python3_xlib
- pyautogui
If do perfectly, preparation is completed!
Now put the image file you want to find in the path. Let's design a program that clicks on the Google logo.
Google logo |
As shown below, capture only a part of Google logo and put in path as google.png file.
![]() |
Capture the red box and make it a png file |
Then write python file like below.
from imagesearch import *
img = './google_logo.png'
pos = imagesearch(img)
if pos[0] != -1:
click_image(img, pos, 'left', 0.1)
Explanation
line 1 from imagesearch import *: imports imagesearch.py
line 3 img = './google_logo.png': Put the path of the image file you want to find in the variable img.
line 4 pos = imagesearch (img): Find the image file and insert the mouse coordinates in the variable pos.
line 5 if pos [0]! = -1: : If pos value is normal, excute.
line 6 click_image (img, pos, 'left', 0.1): Randomly clicks pos position within img size, having a 0.1 second mouse movement time.
Through your browser, open the Google logo window that looks like the image we have, and run that py file. If you recognize the image and click on the Google logo, it's a success!
Thank you.
Korean Language Version link is
(https://pyinweb.blogspot.com/2019/04/imagesearch.html)
라벨:
Autohotkey,
Automation,
imagesearch,
Python
피드 구독하기:
덧글 (Atom)