Skip to content

Instantly share code, notes, and snippets.

@ojii
Created November 24, 2016 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojii/9d12c8101212e9bc60277bc00b462de0 to your computer and use it in GitHub Desktop.
Save ojii/9d12c8101212e9bc60277bc00b462de0 to your computer and use it in GitHub Desktop.
Python 2 in Python 3
import subprocess
def run_in_py2(code):
return subprocess.check_output(['python2', '-c', code])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment