본문 바로가기

전체 글99

pywinauto 11 - 열려있는 어플리케이션 확인 열려있는(현재 동작중인) 어플리케이션을 확인하고 작업해야할 일이 있다. 아래 이유들이 있겠다. 1. 이미 열려진 어플리케이션에서 계속 누적 작업하는 것이 필요 2. 열려진 어플리케이션 종료 필요 3. 열려진 어플리케이션이 없으면, 실행 필요 저번에 만든 메모장 예제를 이용해서, 구현을 해보았다. 메모장이 열려있나 확인해보고, 없으면 새로 메모장을 열고, 열려있는 메모장이 있으면 글씨를 적고 저장한다. 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 # -*- coding: utf-8.. 2020. 2. 19.
pywinauto 9 - popup menu 팝업메뉴 선택 자동화프로그램을 만들다가, 여러가지 난관에 봉착하는데, popup menu control로 그중에 하나이다. 메인 다이얼로그에 상단 메뉴는 menu_select를 이용해서 손쉽게 누를 수가 있다. 하지만, 마우스 오른쪽클릭하고난 뒤에 뜨는 팝업 메뉴는 spy++이나 window spy프로그램으로도 그 핸들 및 특성을 볼 수가 없다. 팝업메뉴 특성상, 마우스가 올려져있는 상태에서만 보이기 때문이다. 아래는 github에서의 한 질문답변 예제이다. https://github.com/pywinauto/pywinauto/issues/647 Unable to select menu item from popup menu in Sublime Text · Issue #647 · pywinauto/pywinauto I c.. 2020. 2. 17.
tqdm 사용법 - python 진행률 프로세스바 파이썬으로 어떤 작업을 수행중인데, 프로그램이 내가 의도한 데로 돌아가고 있는 중인가, 진행상황이 궁금할 때가 있다. 시간이 걸리는 작업의 경우에 더 이런 상태 확인이 필요하다. 파이썬 모듈중에 tqdm이라는 것이 이 용도로 쓰이고 있다. 사용법 tqdm is very versatile and can be used in a number of ways. The three main ones are given below. tqdm은 아주 변하기 쉽고 많은 방법으로 사용될 수 있다. 아래 세가지 주요 방법들이 있다. Iterable-based Wrap tqdm() around any iterable: 어느 이터러블이든 tqdm()로 감싼다. 리스트도 가능. 이터러블이 증가하는 것에 따라서, 진행률 증가. fro.. 2020. 2. 15.
Pandas 1 - csv 데이타 읽고 / 처리 / 추가 / 저장 Pandas csv data사용 예제 1. SavedData.csv에서 값을 pandas Dataframe형식으로 읽는다. 2. Dataframe type을 개별 데이터 처리를 위해서 float type으로 변환 3. 마지막 행 데이타를 이용해서, 새로 데이타를 생성하기 위해서, tail 사용 4. 마지막 행인 series data object를 float으로 변환 5. 데이타 업데이트 처리 후, 한 행짜리 Dataframe생성 6. 기존 전체 Dataframe의 마지막에 추가 7. 추가 업데이트된 SavedData.csv파일 저장 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 3.. 2020. 2. 13.
pywinauto 10 - find window 중복 에러 벗어나기 자동화 프로그램을 만드려면, 내가 컨트롤하고 싶은 단 하나의 window객체를 찾아내야한다. 그러나, 대부분 프로그램들이 같은 타이틀명, 컨트롤네임을 사용하는 경우가 많아서, 내가 원하는 컨트롤 window를 찾을 수 없거나, 두개이상이 찾아졌다는 에러를 자주 볼 수 있다. https://pywinauto.readthedocs.io/en/latest/code/pywinauto.findwindows.html#pywinauto.findwindows.find_elements pywinauto.findwindows — pywinauto 0.6.8 documentation © Copyright 2018, Mark Mc Mahon and Contributors Revision aea0429b. pywinauto.r.. 2020. 2. 12.
pywinauto 8 - 어플리케이션 인스턴스 생성 하나의 Application() 인스턴스를 생성하기 위해서, 1) 해당 application이 실행이 안되어 있는 경우 : start() (해당 설정한 주소의 어플리케이션이 실행됨) 2) 해당 application이 이미 실행되어 있는 경우 : connect() 를 사용한다. 인스턴스 생성후, 이 인스턴스를 이용해서 접근을 하면된다. 아래의 pywinauto 공식 사이트 설명을 참고하기 바란다. https://pywinauto.readthedocs.io/en/latest/HowTo.html#how-to-specify-a-usable-application-instance How To’s — pywinauto 0.6.8 documentation The windows handle of a window of t.. 2020. 2. 11.
pywinauto 7 - 안정적인 자동화 pywinauto 공식사이트 내용을 번역한 것입니다. I start the application as I did before (app.start("C:\setup.exe") and then connect the application (app.connect(title="Setup")) so you are connected to the process that is running the GUI window. 어플리케이션을 start하고나서 connect를 해줘야, 실행중인 window의 프로세스에 connect된다. pywinauto doesn't catch spawing additional processes (but we have plans to make windows manipulation availabl.. 2020. 2. 11.
pywinauto 6 - listview 내 text 읽기/쓰기 Listview class를 컨트롤할 일이 있는데, 엑셀표같은 이 아이템들을 읽고 선택하는 방법을 알아야한다. 예제) text 읽기: listview=app.top_window.window(control_id=1567, class_name="SysListView32") items=listview.items() # Listview내 모든 아이템들 리턴 item_count=listview.item_count() # Listview내 아이템 갯수 리턴 texts=items.texts() # Listview내 아이템들의 텍스트 리턴 https://pywinauto.readthedocs.io/en/latest/code/pywinauto.controls.uia_controls.html#pywinauto.contro.. 2020. 2. 11.
pywinauto 5 - 32bit / 64bit app 종류별 환경 설정 Getting Started Guide Once you have installed pywinauto - how do you get going? The very first necessary thing is to determine which accessibility technology (pywinauto’s backend) could be used for your application. The list of supported accessibility technologies on Windows: Win32 API (backend="win32") - a default backend for now MFC, VB6, VCL, simple WinForms controls and most of the old legac.. 2020. 2. 11.