On Tue, May 15, 2012 at 9:24 AM, Matt Anderson <[email protected]> wrote:
> Jed wins the prize,
>
> It looks like this function may not be any good on 64 bit systems (in
> utils\system.py)
>
> def windows_memory_usage():
> """Return physical memory usage (float)
> Works on Windows platforms only"""
> from ctypes import windll
> from ctypes.wintypes import byref, Structure, DWORD
> class MemoryStatus(Structure):
> _fields_ = [('dwLength', DWORD), ('dwMemoryLoad', DWORD),
> ('dwTotalPhys', DWORD), ('dwAvailPhys', DWORD),
> ('dwTotalPageFile', DWORD), ('dwAvailPageFile', DWORD),
> ('dwTotalVirtual', DWORD), ('dwAvailVirtual', DWORD),]
> memorystatus = MemoryStatus()
> windll.kernel32.GlobalMemoryStatus(byref(memorystatus))
> return float(memorystatus.dwMemoryLoad)
>
>
Yes, running system.py as a script produces the same interpreter crash.
Some days ctypes is your friend. Some days it isn't :).
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/spyderlib?hl=en.