I\'d like to write a short python script that puts my computer to sleep. I\'Ve already searched the API but the only result on suspend has to do with delayed execution. What
You can run shell command from python script. See subprocess module and then search for appropriate command for your operating system.