RE: COM problem .py versus .exe
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

RE: COM problem .py versus .exe

From: Tim Golden <tim.golden@viacom-outdoor.co.uk>
Date: Thu Jun 30 2005 - 15:19:45 CEST

[Greg Miller]
|
| Thanks for the information, I stumbled across that page yesterday. It
| seems all the problems with this are solved. The executable
| works just
| like the Python version. Now I have to come up with an algorithm to
| parse through the output data to come up with the version numbers.

Just in case you haven't managed it (and because I fancied
the challenge), try the code below:
(most information from a post by Roger Upole)

<code>
import win32api

lo = win32api.LOWORD
hi = win32api.HIWORD

def get_version_number (filename):
  info = win32api.GetFileVersionInfo (filename, "\\")
  ms = info['FileVersionMS']
  ls = info['FileVersionLS']
  return hi (ms), lo (ms), hi (ls), lo (ls)

if __name__ == '__main__':
  filename = "c:/python24/python24.dll"
  print ".".join ([str (i) for i in get_version_number (filename)])

</code>

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
Received on Thu Sep 29 16:40:05 2005