nofiles = len(os.listdir('/proc/%d/fd/*' % getpid()))
that may be portable enough for Linux, but I'm not aware of another method.
nofiles = len(os. listdir( '/proc/ %d/fd/* ' % getpid()))
that may be portable enough for Linux, but I'm not aware of another method.