Since you said this is a Linux server, calling the external ps binary is usually slower, uses more resources and is more error prone than using the information from /proc directly.
Since nobody else mentioned, one simple way is:
glob.glob('/proc/[0-9]*/')
Good luck.