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.
|
|
Other
|
GDS AddFile is a simple Google Desktop Search (GDS) component (source included), to manually add text files and source code from different development languages to your index - like code favorites which you want absolutly find from the index.
|
|
|
Other
|
|
If you want to save a text file with Python to a FTP server, you could use this:
from ftplib import FTP
ftp = FTP("myhost.com")
ftp.login("username", "password")
# open the file to read it as a file like object
f = open("myfile.txt", "r")
# Open directory
ftp.cwd("/pub/cms/textfiles")
# save file like object as to the ftp path /pub/cms/textfiles
ftp.storlines("STOR myfile.txt", f)
ftp.quit()
f.close()
If it is a binary file, you should take ftp.storbinary() with the same arguments.
|
|
|
Microsoft Windows
|
|
I found a Python receipt at Activestate which can copy the Path of a file or the path of multiple files from the explorer into the Windows clipboard. Very handy.
|
|
|
Microsoft Windows
|
|
There is a Python script template/example, which makes developing Windows services much easier. Simply derive the start and stop method from the template and implement your own actions. The rest is defined in the template, which you have to import:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/551780
|
|
|
OpenOffice
|
from win32com.client.dynamic import Dispatch
objServiceManager = Dispatch('com.sun.star.ServiceManager')
Stardesktop = objServiceManager.CreateInstance('com.sun.star.frame.Desktop')
doc = Stardesktop.loadComponentfromURL('private:factory/swriter', '_blank', 0, [])
text = doc.getText()
text.setString("Hello World")
|
|
|
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
|
| Results 21 - 25 of 95 |