added free ram func
authorEduardo <[email protected]>
Sun, 10 Dec 2023 21:58:51 +0000 (22:58 +0100)
committerEduardo <[email protected]>
Sun, 10 Dec 2023 21:58:51 +0000 (22:58 +0100)
utils.py

index aa1ec96ae9595c43e94d66aa58b1e0b6cac8f0cf..5f7231c0de1b985e4cdb93e7bd637a7d64284e29 100644 (file)
--- a/utils.py
+++ b/utils.py
@@ -1,5 +1,10 @@
+from gc import collect, mem_free
 from os import statvfs
 
 def df():
     s = statvfs('//')
-    return ('{0} MB'.format((s[0]*s[3])/1048576))
+    return ('{0} MB / 16 MB'.format((s[0]*s[3])/1048576))
+
+def free():
+    collect()
+    return ('{0} KB / 264 KB'.format(mem_free()/1024))