Skip to content

Instantly share code, notes, and snippets.

@richo
Created May 14, 2015 00:04
Show Gist options
  • Select an option

  • Save richo/edb87ba5edea389f3795 to your computer and use it in GitHub Desktop.

Select an option

Save richo/edb87ba5edea389f3795 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import os
import tempfile
fd, name = tempfile.mkstemp()
ret = os.system("$EDITOR '%s'" % (name))
if ret != 0:
raise "Your editor exited non-zero"
with open(name) as fh:
print "You entered:"
print fh.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment