version of python?

Holger Jannsen holger at
Fri Jun 25 09:38:52 EDT 1999


How could I get the version-number of the installed python-interpreter?

I need this because I got an error under Python 1.51 (on my WinNT-test-machine)
when running a script for linking files:

def createLink(filePath, linkPath, args, descr, wrkngDir):
        "creates a link to a file"
        import pythoncom
        from import shell
        #get the shell interface
        sh = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None,
pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink)
        #get an IPersist interface
        persist = sh.QueryInterface(pythoncom.IID_IPersistFile)
        #set the data
        sh.SetPath( filePath )
        #save the link itself.
        persist.Save(linkPath, 1)  

  File "C:\myPython\phoenix\", line 886, in ?
  File "C:\myPython\phoenix\", line 839, in startInstallation
  File "C:\myPython\phoenix\", line 615, in _runInstallation
  File "C:\myPython\phoenix\", line 808, in _linkFiles
    createLink(pFilePath, pLinkPath, pArguments , pDescription, pWrkngDir)
  File "C:\myPython\phoenix\", line 334, in createLink
    sh = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCT
X_INPROC_SERVER, shell.IID_IShellLink)
AttributeError: CLSID_ShellLink

I tested with Python 1.52 on my working-place: Everything OK!
But, I wonder a little bit about that. win32com-modules havn't changed
since "Sat Dec 05 19:30:34 1998" as mentioned in win32com.txt (this one 
I found on my harddisk...;-)))
And I'm fortunaly sure that this version of 'Python 1.5 combined Win32 extensions'
is the same as on the other computer.

So what? How could this be?
(sorry, couldn't have a look source of win32com, because it's not within
the windows-version)


More information about the Python-list mailing list