1

i want to get memory information like (total, free and used). But i should use python own library. Not with psutil or smth.

I'm on Mac and using 2.7 python.

For example when i tried ;

import sys
if sys.platform == 'win32':
  import win32_sysinfo as sysinfo
elif sys.platform == 'darwin':
  import mac_sysinfo as sysinfo
elif 'linux' in sys.platform:
  import linux_sysinfo as sysinfo

print 'Memory available:', sysinfo.memory_available()

i get;

Traceback (most recent call last):
  File "/Users/Elfendos/Documents/Phyton/deneme.py", line 5, in <module>
    import mac_sysinfo as sysinfo
ImportError: No module named mac_sysinfo
8
  • stackoverflow.com/questions/276052/…, stackoverflow.com/questions/22102999/…, stackoverflow.com/questions/466684/… might help you. Commented Oct 14, 2015 at 19:51
  • Could you please post the code you tried and the output you received? Commented Oct 14, 2015 at 20:24
  • I tried linkes but doesnt work. Even i tried them with empty .py file. Commented Oct 14, 2015 at 20:29
  • Edit your question and post the code along with the error. Make sure you use the formatting tools above the editing textbox to ensure your code looks readable. Include whether you are working on Windows, OSX or Linux and also indicate the version of python on your system. Doesn't work gives me very little to work with. Commented Oct 14, 2015 at 20:32
  • Good edit. I don't have OSX handy. This might be worth a try: stackoverflow.com/questions/467600/… and this fa.bianp.net/blog/2013/…. Please do post back a solution that worked for you. Commented Oct 14, 2015 at 20:42

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.