- AuthorPosts
- July 4, 2007 at 9:27 am #4456leo_zzzParticipant
I want to use Python as my Macro scripting language, I did as Macro reference told:
#language = “Python”
Window.document.write( ‘Hello’ );but it failed with “Python specified language not registered in this system”, but I have already installed the Python in my system, could anyone tell me what special action should I take to make the Python scripting works?
July 4, 2007 at 8:33 pm #4457VladMemberIf you installed official Python distribution from http://www.python.org you should also install Python for Windows extensions:
home page: http://starship.python.net/crew/mhammond/win32/
download page: http://sourceforge.net/project/showfiles.php?group_id=78018Make sure to select installer version corresponding to your Python version, that is pywin32-210.win32-py2.5.exe if you have Python 2.5.x
If everything was installed correctly you should be able to run this python script:
import win32api
import win32com.client
WshShell = win32com.client.Dispatch(‘WScript.Shell’)
WshShell.Run(‘notepad.exe’)
win32api.Sleep(1000)
WshShell.SendKeys( ‘everything is ok{ENTER}’ )July 5, 2007 at 4:29 am #4458leo_zzzParticipantit works !
thanks a lot, man:)January 26, 2012 at 8:57 pm #9902ArthurZParticipantI am also interested in writing macros in Python
Did this question get resolved? - AuthorPosts
- You must be logged in to reply to this topic.