RSS category feeds

RSS site feeds

More related

Thanks to...

Home arrow Script Collection
Script Collection

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.



Use Win32 Registry like a Python dictionary PDF Print E-mail
Microsoft Windows
The class found on Activestate wraps most of the win32api functions for accessing a registry. It will read and write all win32 registry types, and will de/serialize python objects to registry keys when a string or integer representation is not possible. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/551761
 
Python Class for Microsoft Access PDF Print E-mail
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

 
Let merlin think (MS Agent automation) PDF Print E-mail
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)
 
Autocad Automation PDF Print E-mail
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 Acrobat and Acrobat 3D Batch extension PDF Print E-mail
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

Feedback

Comments

  • I tried this for outlook 2007 and it doesn't work, but python doesn't have an er... More...
  • I never understood why people don't include the import statements at the top of ... More...
  • Thanks friend! ;-) Work really apprecciated from italy! More...
  • y am I not being allowed to view more on catia scripts. More...
  • eval('item.%s' % attribute) should be written as getattr(item, attribute) More...

Login Form






Lost Password?
No account yet? Register

My prefered Python IDE

My prefered Python editor is Pyscripter from MMExperts. It is not only an editor. Pyscripter is a full Python IDE including (remote) debugging, a class browser, and all other nice helpers which a full featured IDE needs.

Do you have a script for me ?

Do you have an interesting Python script which does some really cool thing on Windows ? Please post them to this site. It`s very simple - simply copy&paste it to this form. No login is requiered.

Hint: For syntax highlighting and correct Python intendation place your code between html tags <pre> and </pre>.

My prefered web framework

My prefered web framework for developing web applications is Django. Django calls itself The web framework for perfectionists with deadlines. It is a really fast, scalable and (thanks Python) the sexiest web framework of the world.