Examples for automating Windows applications via the Microsoft
Component Object Model (COM), Win32API, PythonCOM and other interesting
Python modules. Mainly developed with the Python Windows Extensions from Marc Hammond. If you want to post a script, article or news please use this link Post a Python script. Hint: For sytax highlighting place your code between the tags <pre> and </pre>
This section as RSS feed.
|
|
|
Microsoft Access
|
|
A Python class for extracting and manipulating data from Microsoft Access - identifying tables, getting recordsets, iterating through the results, counting rows, getting field names, getting index information, deleting indexes, and adding and deleting relationships.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/528868
|
|
|
Microsoft Office
|
import win32com.client
ag=win32com.client.Dispatch("Agent.Control")
ag.Connected=1
ag.Characters.Load("Merlin")
ag.Characters("Merlin").Show()
text = raw_input("please type something...")
ag.Characters("Merlin").Think(text)
|
|
|
CAD Systems
|
This example comes from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440493. It searches the ModelSpace collection for text objects. Once found it casts them and alter one of the text specific properties. To test this code AutoCAD must be started with a blank file open add at least one dtext object with 'Spam' as its value:
import win32com.client
acad = win32com.client.Dispatch("AutoCAD.Application")
doc = acad.ActiveDocument # Document object
ms = doc.ModelSpace # Modelspace "collection"
count = ms.Count # Number of items in modelspace
for i in range(count):
item = ms.Item(i)
if 'text' in item.ObjectName.lower(): # Text objects are AcDbText
# once we know what it is we can cast it
text = win32com.client.CastTo(item, "IAcadText")
if text.TextString == "Spam":
text.TextString = "Maps"
text.Update()
|
|
|
Adobe Applications
|
|
This is a PDF Batch Converter extension for Adobe Acrobat and Acrobat 3D. This tool converts 3D CAD models to 3D-PDF as well as Office documents to PDF and works in following modes:
- Convert single files
- Convert files in a directory in batch
- Converts a type of files with wildcards like *.CATPart, *.prt, *.model, ...
- Works as a deamon which watches into a directory (directory watcher)
If you want to download a compiled version: http://www.goermezer.de/dmdocuments/Acrobat2PDF.zip
|
|
|
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
|
| Results 26 - 30 of 95 |