Automate edit control filling in Windows GUI application with Python and Spy++

There is a Windows GUI application in which you need to fill text to edit controls. There are four pages, each page has two edit controls. Each time you need to fill text to two edit controls on a page then click next button to next page and so on. If you need to use the application daily and .

Upload folders from Windows to Linux sftp server with Python Paramiko

There is a folder is generated on daily basis, and the folder should be uploaded to a Linux server through sftp protocol on the next day. Instead of manually uploading it every day, we can do it in a script on Task Scheduler or cron job if it's Linux client.

Extract text and images from doc or docx file with Python

] An alternative way to save text and images separately is to simply save your doc or docx as HTML files, what ... . Suppose you are tasked with the job that given a doc or docx file, you need to post the content ... as file. This is a cumbersome and repetitive process. It will be good if we can extract the text ... , set the ProgID as word.application. With the COM object we can open a doc file and Save it as docx

Python minidom Parsing XML example

To work with the XML in Python, you never run out of libraries, to accomplish a complex job ... -in xml module like minidom. This post illustrate how to use minidom with some code examples ... > </section> </chapter> </part> </contents> [Parsing and navigate XML elements] Import ... . [The test XML document] Suppose we are working on the XML document like below <?xml version="1.0

Use SAX to extract data from XML with Python

approach is SAX which means Simple API to XML, internally, it will uses a walker to traverse the tree ... to react. In Python SAX module, you will extends the class xml.sax.handler.ContentHandler. It has ... There are two approaches to manipulate XML document, the first one is DOM which build ... the elements tree in memory and use selector or API(getElementByTagName, getChild, etc) to visit elements

Convert XML to HTML with lxml XSLT in Python

to get it displayed in HTML. We will use XSLT module of the lxml library in Python <contents> <part title ... > And the XSLT template used to transform it to HTML <xsl:stylesheet version="1.0 ... > </xsl:template> </xsl:stylesheet> The python code: import lxml.html from lxml import etree ... The source document is a table of contents written in XML format, and we want

Python lxml example find link by text content

. This example shows how to find element with specified text content and print the element with lxml ... > </div> Here is the Python code to locate the link with text content "hello" and then output the url ... and text of the link import lxml.html from lxml import etree html = lxml.html.parse("xml-xpath ... -example-test.html") link = html.xpath("/html/body/div[@class='list']//li/a[text()='hello']") print

Python Why lxml etree tostring method returns bytes

want to use the etree.tostring method to print the content of the parsed HTML, it returns bytes ... When using lxml library in Python, I found the API a little bit strange. For example when I ... . from lxml import etree print(etree.tostring(html)) It prints things like this b'<!DOCTYPE html ... (etree.tostring(html).decode('utf-8')) But the method name indicates it should return a string. Why this design

How to use XPath syntax example with Python and lxml

the syntax of XPath with an example HTML file and lxml api. [Create example HTML file] Create ... import lxml.html html = lxml.html.parse("xpath-test.html") [Child operator /] Use this operator ... The lxml is a Pythonic binding for the C libraries libxml2 and libxslt ... which quite easy to use. For simple query like finding a tag, you can use findtext, but for complex

Kill process with Python on Windows

. You can kill them in task manager manually, or you can do it in a Python script with more flexibility ... to interactive with processes on Windows. The psutil provides an abstract interface to process related API ... . Python is a powerful tool if you want to script around win32 API. There are many methods ... (): if proc.name() == name: print("Killing process: " + name
1 2 ... 5 Next Page