title: Using cat command in Python for printing
body: <p>In the Linux kernel, I can send a file to the printer using the following command</p>
  
  <pre><code>cat file.txt &gt; /dev/usb/lp0
  </code></pre>
  
  <p>From what I understand, this redirects the contents in file.txt into the printing location.  I tried using the following command</p>
  
  <pre><code>&gt;&gt;os.system('cat file.txt &gt; /dev/usb/lp0') 
  </code></pre>
  
  <p>I thought this command would achieve the same thing, but it gave me a "Permission Denied" error.  In the command line, I would run the following command prior to concatenating.  </p>
  
  <pre><code>sudo chown root:lpadmin /dev/usb/lp0
  </code></pre>
  
  <p>Is there a better way to do this?</p>