Created
February 27, 2017 09:05
-
-
Save MagerValp/9fc82104e0528086e5c49edb5746ecb7 to your computer and use it in GitHub Desktop.
Python 2 template
This file contains 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/python | |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
from __future__ import division | |
import io | |
import sys | |
import codecs | |
if sys.stdout.encoding != "UTF-8": | |
sys.stdout = codecs.getwriter("utf-8")(sys.stdout, "strict") | |
if sys.stderr.encoding != "UTF-8": | |
sys.stderr = codecs.getwriter("utf-8")(sys.stderr, "strict") | |
import argparse | |
def main(argv): | |
p = argparse.ArgumentParser() | |
p.add_argument("-v", "--verbose", action="store_true", | |
help="Verbose output.") | |
args = p.parse_args([x.decode("utf-8") for x in argv[1:]]) | |
return 0 | |
if __name__ == '__main__': | |
sys.exit(main(sys.argv)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment