Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

☆(´∀`)★Win32★(,,゚Д゚)☆

Name: Anonymous 2007-03-15 14:39 ID:GJc0/qHH

This Python code gets the memory usage for a given process:
[code]
    def memory_usage(self):
        """Returns the memory usage of the process specified in settings["Process"]"""
        path = win32pdh.MakeCounterPath( (None, "Process", self.settings["Process"], None, -1, "Private Bytes") )
       
        hq = win32pdh.OpenQuery()
        hc = win32pdh.AddCounter(hq, path)
       
        win32pdh.CollectQueryData(hq)
        type, val = win32pdh.GetFormattedCounterValue(hc, win32pdh.PDH_FMT_LONG)
        return val
[code]

Now I'd like to see someone do this nicer in [insert-your-language-of-choice-here]. Hah!

Name: Anonymous 2007-03-16 18:57 ID:x9J0q9LD

>>22
Stupid people bash Python. What can we deduce from this?

1. Stupid people like shit. Python must be not shit, because stupid people don't like it.
2. Stupid people don't write Python code. Python's community is thus expected to be rather free of stupidity.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List