Mailing List Archive

version of python?
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
version of python? [ In reply to ]
>How could I get the version-number of the installed python-interpreter?

Python 1.5.2 (#3, May 23 1999, 10:48:24) [C] on aix4
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import sys
>>> sys.version
'1.5.2 (#3, May 23 1999, 10:48:24) [C]'

-greg

---------------------
Dr. Greg Landrum (landrumSPAM@foreman.ac.rwth-aachen.de)
Institute of Inorganic Chemistry
Aachen University of Technology
version of python? [ In reply to ]
BTW:

In that source I could set arguments, working-directory,
and other things... Do y'a know the way to set the size
of starting window (e.g. minimized, maximized ...)?

Thanx,
Holger