Some software interfaces use Win32 windows to nest an IE control. With spy ++, only one Internet assumer_server control can be identified. Several common API functions cannot obtain the content in the IE control, and cannot operate the control in the control. Therefore, automation is troublesome. This article describes how to use python to obtain the ihtmldocument2 interface for automated testing.
Get ihtmldocument2 Interface
Reference: http://support.microsoft.com/kb/249232The corresponding Pyt
Some software interfaces use Win32 windows to nest an IE control. With spy ++, only one Internet assumer_server control can be identified. Several common API functions cannot obtain the content in the IE control, and cannot operate the control in the control. Therefore, automation is troublesome. This article describes how to use python to obtain the ihtmldocument2 interface for automated testing.
Get ihtmldocument2 Interface
Reference: http://support.microsoft.com/kb/249232Python implementati
Pyhook Download: HTTP://SOURCEFORGE.NET/PROJECTS/PYHOOK/FILES/PYHOOK/1.5.1/
PYHOOKAPI Manual: Http://pyhook.sourceforge.net/doc_1.5.0/
The above Web site provides several examples of use, in addition to installing pyhooks, there will also be an example of the file. So I took it to study, the first run, prompted no pythoncom module, installed the Pywin32, installed, can be normal operation, but will lead to machine hairpin, especially after the inter
Python uses pyhook for keyboard monitoring.
Pyhook download: http://sourceforge.net/projects/pyhook/files/pyhook/1.5.1/
PyhookAPI reference: http://pyhook.sourceforge.net/doc_1.5.0/
The above website provides several examples. In addition, after installing pyhooks, there will also be an example file. So I learned about it. During the first running, I was prompted that pywin32 was installed without the pythoncom module. After installation, it can run n
This example describes how Python automatically invokes IE to open a Web site. Share to everyone for your reference. The implementation methods are as follows:
?
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
Import Win32gui Import win32com import win32com.client import pythoncom Import time Class Test:def runtest (self): print ' Test ' class Eventhandler:def onvisible (self,visible): global bvisibleeve
Pyhooks
Download:Http://sourceforge.net/projects/pyhook/files/pyhook/1.5.1/
API manual:Http://pyhook.sourceforge.net/doc_1.5.0/
An example is provided on the above website. In addition, after installing pyhooks, there will also be an example file. So I learned how to install pywin32 when I first run it, prompting that the pythoncom module is not available. After the installation, it can run normally, but it will cause the machine to issue a card
1. When you use multithreaded programming, and you need to call the Win32com module to open a Word document, common errors are as follows:IDispatch = pythoncom. CoCreateInstance (IDispatch, None, Clsctx, pythoncom. IID_IDispatch) Com_error: ( -2147221008, ' \xc9\xd0\xce\xb4\xb5\xf7\xd3\xc3 coinitialize\xa1\xa3 ', none, none)The second item in the second line of error is printed: "CoInitialize not yet called
This article describes how to capture and simulate mouse events in Python, and describes how to use the PyHook and PyWin32 modules, for more information about how to capture and simulate mouse events in Python, see the following example. Share it with you for your reference. The specific analysis is as follows:
This holiday has played a lot of galgames, but some very old games do not have an automatic running mode. clicking the mouse is too damaging, so I want to map the scroll mouse wheel to c
Python uses the pyhook keyboard to monitor and implement the function of switching songs.
When you are playing dota, you sometimes like to play games and listen to music, but you have to switch out of the game when switching the next song, and switching the music's Hot Key ctrl + alt + direction key is useless during the game, this is a good thing. Today, I try to use python to implement a keyboard monitoring switch. Next, I will post the code below.
Import
(1) The test code:Import IEC
(2) The IEC module download URL:Http://www.mayukhbose.com/python/IEC/index.php
(3) I ran the test code in pyscripter-portable, and I gotFollowing error message:
* ** Python 2.5.4 (r254: 67916, Dec 23 2008, 15:10:54) [MSC v.1310 32Bit (Intel)] on win32 .***>>>Traceback (most recent call last ):File "File "E:/PPy/libdl/module3.py", line 1, in Import IECFile "E:/PPy/libdl/IEC. py", line 40, in File "E:/PPy/APP/lib/Site-packages/win32com/_ init _. py", line 6, inImport
With Pywin32, can you do whatever you like on Windows?Yes.#-*-coding:cp936-*-# import osimport pythoncomfrom Win32com.shell import shellfrom Win32com.shell import shellcondef Set_shortcut (filename,lnkname,iconname): #如无需特别设置图标, you can remove the iconname parameter shortcut = pythoncom. CoCreateInstance (Shell. Clsid_shelllink, None, pythoncom. Clsctx_inproc_server, Shell. Iid_ishelllink) shortcut. SetPath
This holiday has played a lot of galgame, but some very old game does not automatically run mode, click the mouse and too hurt the button, so want to roll the mouse wheel map to click the mouse.
Online search, did not find any off-the-shelf software, and the key wizard is too heavy, so consider simply using Python to write a forget.
Very lucky to find the "with Python monitor mouse and keyboard events" This article, so the Pyhook and PyWin32 are installed (recommended under EXE version, lest t
This example describes how Python automatically calls ie to open a Web site. Share to everyone for your reference. The implementation method is as follows:
Import Win32gui Import win32com import win32com.client import pythoncom Import time class Test: def runtest (self):
print ' Test ' class EventHandler: def onvisible (self,visible): Global bvisibleeventfired bvisibleeventfired = 1 def ondownloadbegin (self): print ' Downloa
The examples in this article describe Python's approach to capturing and simulating mouse events. Share to everyone for your reference. The specific analysis is as follows:
This holiday played a lot of galgame, but some very old game does not automatically run mode, click the mouse and too hurt the button, so you want to scroll the mouse wheel map to click the mouse.
Search on the Internet, did not find any ready-made software, and the key wizard is too heavy, so consider simply their own pytho
Python Programming Simple Trojan Light2015/01/26 10:070x00 PreparationThe content of the article is for study only, not for illegal use!This time we use Python to write a simple Trojan with Keylogger, screenshot, and communication functions. Still choose Sublime Text2 +jedi (Python auto-complete plug-in) to the code, install the configuration JEDI plug-in can be referenced here:/tips/?id=4413First, prepare the dependent libraries, Python hooks and pythoncom
First, needless to say, install Django-sqlserver pip install django-sqlserver and then modify ' ENGINE ': ' Sqlserver_ado ' in settings.py, However, the port number can not be filled out SQL Server does not need. And then the syncdb appeared.No moduls name pythoncom read the above error import pythoncom errors, the results of a large number of search for relevant information, here want to say a Baidu really
Pyhook is a python-based "Hook" library that listens primarily to events on the mouse and keyboard on the current computer. This library relies on another Python library PyWin32, as the name shows, PyWin32 can only run on the Windows platform, so Pyhook can only run on the Windows platform.
With regard to the use of Pyhook, there is a simple tutorial on its official home page, which is generally used to
#-*-Coding:utf-8-*-# 3import pythoncom 4im
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.