Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: get_used_memory Date: Sat, 13 Jun 2026 12:38:08 -0700 Organization: A noiseless patient Spider Lines: 10 Message-ID: <8733yq9qov.fsf@nightsong.com> References: <110fvf3$1tqe3$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 13 Jun 2026 19:38:08 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3324937"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BK+NbipEZzuz24VRdTpV9"; posting-host="97593064da46a97ab378384505603dfa" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:wxV6FdFTFJhPyrURz7Cg4ER0oEA= sha1:x3hnDF/8xn89TWI+kC/Id3TpvSQ= sha256:Rriy2V5YRjVDB9dQlhtBYKgQzhaJ/K21OcK5SsS5eJ0= sha1:PBibEpt7DbZ/xpWoEF2oNexT8m8= Xref: csiph.com comp.lang.python:197803 Jon Ribbens writes: > with open('/proc/meminfo') as meminfo: > info = { > entry[0][:-1]: int(entry[1]) > for line in meminfo > if (entry := line.split()) > } with open('/proc/meminfo') as meminfo: info = dict(line.split()[:2] for line in meminfo)