Created
October 23, 2014 00:12
-
-
Save dutc/5a718c7c4411c2b10b55 to your computer and use it in GitHub Desktop.
dedenting helpers for use with vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from textwrap import dedent | |
if __name__ == '__main__': | |
from sys import stdin | |
exec dedent(''.join(stdin)) in locals(), globals() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from textwrap import dedent | |
if __name__ == '__main__': | |
from sys import stdin | |
exec(dedent(''.join(stdin)), locals(), globals()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use in
vim
to send lines from an unsaved file directly to an interpreter: