(Unix only, Optional) The resource
module is used to query or modify the
system resource current settings limits. Example 12-10 shows how to use the module to query, and Example 12-11 shows how to modify resource limits.
Example 12-10. Using the resource Module to Query Current Settings
File: resource-example-1.py import resource print "usage stats", "=>", resource.getrusage(resource.RUSAGE_SELF) print "max cpu", "=>", resource.getrlimit(resource.RLIMIT_CPU) print "max data", "=>", resource.getrlimit(resource.RLIMIT_DATA) print "max processes", "=>", resource.getrlimit(resource.RLIMIT_NPROC) print "page size", "=>", resource.getpagesize()usage stats => (0.03, 0.02, 0, 0, 0, 0, 75, 168, 0, 0, 0, 0, 0, 0, 0, 0)
max cpu => (2147483647, 2147483647)
max data => (2147483647, 2147483647)
max processes => (256, 256)
page size => 4096
3.137.217.198