version of python?

Holger Jannsen holger at phoenix-edv.netzservice.de
Fri Jun 25 09:38:52 EDT 1999


Hi!

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 win32com.shell 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 )
        sh.SetDescription(descr)
        sh.SetWorkingDirectory(wrkngDir)
        sh.SetArguments(args)
        #save the link itself.
        persist.Save(linkPath, 1)  


  File "C:\myPython\phoenix\installation.py", line 886, in ?
    startInstallation()
  File "C:\myPython\phoenix\installation.py", line 839, in startInstallation
    ins._runInstallation()
  File "C:\myPython\phoenix\installation.py", line 615, in _runInstallation
    self._linkFiles(anOrder)
  File "C:\myPython\phoenix\installation.py", line 808, in _linkFiles
    createLink(pFilePath, pLinkPath, pArguments , pDescription, pWrkngDir)
  File "C:\myPython\phoenix\installation.py", 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)

ciao,
Holger




More information about the Python-list mailing list