title: python subprocess output without \n
body: <p>Here is a simple script running subprocess that retrieves IP from the <code>ifconfig</code> command output from the terminal.
  I have noticed that <code>subprocess.check_output()</code> always returns a value with <code>\n</code>.</p>
  
  <p>I desire to get a return value <strong>without <code>\n</code></strong>.
  How can this be done?</p>
  
  <pre><code>$ python
  &gt;&gt;&gt; import subprocess
  &gt;&gt;&gt; subprocess.check_output("ifconfig en0 | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'", shell=True)
  '129.194.246.245\n'
  </code></pre>