def pyrun(src):
 if PY3:
  src = bytes(src, 'ascii')
 with tempfile.NamedTemporaryFile(prefix=TESTFILE_PREFIX, delete=False) as f:
  _testfiles.append(f.name)
  f.write(src)
  f.flush()
  subp = get_test_subprocess([PYTHON, f.name], stdout=None, stderr=None)
  wait_for_pid(subp.pid)
  return subp

def pyrun ( src ) : if PY3 : src = bytes ( src , 'ascii' ) with tempfile . NamedTemporaryFile ( prefix = TESTFILE_PREFIX , delete = False ) as f : _testfiles . append ( f . name ) f . write ( src ) f . flush ( ) subp = get_test_subprocess ( [ PYTHON , f . name ] , stdout = None , stderr = None ) wait_for_pid ( subp . pid ) return subp
run python src code in a separate interpreter .