#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Python - cim_datafile - get file version


    All,

    I am trying to use python to get the version of a file. I have tried multiple times and different methods with python and I am reaching out for help. Any pointers would be great.


    Code:
    def checkNotepadFileVersions(self, table=None): if not table: table = prettytable.PrettyTable(["Server", "FileName", "File Version"]) for entry in self.wmi.CIM_Datafile(name='c:\\Windows\\System32\\notepad.exe'): table.add_row( [ self.hostname, entry.FileName, entry.Version ] ) return table
    This code returns nothing....
    Code:
    import wmi getinstance = wmi.WMI() for f in getinstance.CIM_DataFile (Name='c:\\Windows\\System32\\notepad.exe'): print f.version

    Thanks
    Rob
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,854
    Rep Power
    481

    Program to solve your troubles


    Code:
    import fractions gcd = fractions.gcd omega = 100 for u in range(1,omega): uu = u*u for v in range(u+1,omega): if 1 == gcd(u,v): vv = v*v triple = [vv-uu,2*u*v,vv+uu,] triple.sort() print(u,v,triple) # http://mathworld.wolfram.com/PythagoreanTriple.html
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0
    Thanks for the help.

    ANy other ideas?

IMN logo majestic logo threadwatch logo seochat tools logo