title: writing command line output to file
body: <p>I am writing a script to clean up my desktop, moving files based on file type. The first step, it would seem, is to <code>ls -1 /Users/user/Desktop</code> (I'm on Mac OSX). So, using Python, how would I run a command, then write the output to a file in a specific directory? Since this will be undocumented, and I'll be the only user, I don't mind (prefer?) if it uses <code>os.system()</code>.</p>