import subprocess
proc = subprocess.Popen(['ls','-la', some-other-args], stdout = subprocess.PIPE, stderr = subprocess.PIPE)
out, err = proc.communicate()
def func(a, b):
print a or b
func(None, 'q')
func(123, 10)
func([1,2,3],'')
func('', {1: 5})
q 123 [1, 2, 3] {1: 5}