[IronPython] IronPython Studio question.

Anthony Boudouvas anthony-b at mediatel.gr
Mon Dec 31 18:21:13 CET 2007


i just downloaded and installed IronPython Studio, a very impressive work 
indeed. Is this possible to import modules like normal CPython 2.5 usage 
(modules that have nothing to do with .net stuff, like win32api or PyQt, for 
instance) and succesfully build the project ??

I tried the following code but it says cannot import modue "win32pdh".

Thanks for any help.

import win32pdh, string, win32api, os

def procIDSs():
    junk, instances = win32pdh.EnumObjectItems(None, None, "process", 
    proc_ids = []
    proc_dict = {}
    for instance in instances:
        if instance in proc_dict:
            proc_dict[instance] = proc_dict[instance] + 1
            proc_dict[instance] = 0
    for instance, max_instance in proc_dict.items():
        for inum in xrange(max_instance + 1):
            hq = win32pdh.OpenQuery()
            path = win32pdh.MakeCounterPath((None, "process", instance, 
None, inum, "ID Process"))
            counter_handle = win32pdh.AddCounter(hq, path)
            type, val = win32pdh.GetFormattedCounterValue(counter_handle, 
            proc_ids.append((instance, str(val)))
    return proc_ids

for process in procIDSs():
    print process [mailto:users at lists.ironpython.com]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20071231/79c1a48b/attachment.html>

More information about the Ironpython-users mailing list