Command line programs can be called with the subprocess module. However, it's likely to be disabled on X10 for security purposes, if that's where you're running the Python script.
Actually I run it on my own pc. It was just a general programming question. If somethings are blocked for security issues, that may let me know how it works on my pc.
You should always develop on your own machine, pushing to the production server only when stable. For one thing, you have more control over your own server and can debug apps interactively.