title: What is Python's equivalent to 'ulimit'?
body: <p>I'm trying to implement a check on system resources for the current shell (basically everything in <a href="https://ss64.com/bash/ulimit.html" rel="nofollow noreferrer"><code>ulimit</code></a>) in Python to see if enough resources can be allocated. I've found the <a href="https://docs.python.org/2/library/resource.html" rel="nofollow noreferrer"><code>resource</code></a> module, but it doesn't seem to have all the information <code>ulimit</code> provides (e.g. <code>POSIX message queues</code> and <code>real-time priority</code>). Is there a way to find the soft and hard limits for these in Python without using external libraries? I'd like to avoid running <code>ulimit</code> as a subprocess if possible but if it's the only way, will do so.</p>