title: How to set output of python script as variable in a different python script?
body: <p>I am using a Temper1F sensor, the code base I am using is at <a href="https://github.com/urwen/temper" rel="nofollow noreferrer">https://github.com/urwen/temper</a>. The temper.py code returns an out put as seen below. </p>
  
  <pre><code>$ python3 temper.py
  Bus 001 Dev 006 413d:2107 TEMPerX_V3.3 22.6C 72.7F - - - -
  </code></pre>
  
  <p>I would like to take that output and put it as a string variable in a different python script. I have tried using os. How can I invoke the other python script and store the output to variable?</p>
  
  <p>I have tried the following methods:</p>
  
  <pre><code>from subprocess import call
  var = str(call(["python", "temper.py"]))
  var2 = call(["python", "temper.py"])
  
  import os 
  os.system('python temper.py')
  
  import temper
  var = temper
  </code></pre>
  
  <p>The call method returns a 0. </p>