Revisions
-
nhoffman revised this gist
Dec 6, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ """ from __future__ import print_function import os import sys import argparse @@ -20,7 +21,7 @@ def main(arguments): args = parser.parse_args(arguments) print(args) if __name__ == '__main__': sys.exit(main(sys.argv[1:])) -
nhoffman revised this gist
Dec 6, 2016 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,9 @@ def main(arguments): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('infile', help="Input file", type=argparse.FileType('r')) parser.add_argument('-o', '--outfile', help="Output file", default=sys.stdout, type=argparse.FileType('w')) -
nhoffman revised this gist
Sep 3, 2014 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,25 @@ #!/usr/bin/env python """A simple python script template. """ import os import sys import argparse def main(arguments): parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('infile', help="Input file", type=argparse.FileType('r')) parser.add_argument('-o', '--outfile', help="Output file", default=sys.stdout, type=argparse.FileType('w')) args = parser.parse_args(arguments) print args if __name__ == '__main__': sys.exit(main(sys.argv[1:])) -
nhoffman revised this gist
Apr 21, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,9 @@ def main(arguments): parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('infile', help = "Input file", type = argparse.FileType('r')) parser.add_argument('-o', '--outfile', help = "Output file", default=sys.stdout, type = argparse.FileType('w')) args = parser.parse_args(arguments) -
nhoffman revised this gist
Oct 14, 2013 . 1 changed file with 6 additions and 21 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,7 @@ #!/usr/bin/env python """A simple python script template. """ import os @@ -29,12 +14,12 @@ def main(arguments): formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('infile', help = "A required input file", type = argparse.FileType('r')) parser.add_argument('-o', '--outfile', help = "An optional output file", default=sys.stdout, type = argparse.FileType('w')) args = parser.parse_args(arguments) print args if __name__ == '__main__': sys.exit(main(sys.argv[1:])) -
nhoffman created this gist
Jun 27, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ #!/usr/bin/env python """ A simple python script template. Get me like this: curl -s 'https://dl.dropbox.com/s/n9ssyqb0ndbm32l/script.py?dl=1' > newname.py Or in your [ba|z]sh.login: function pyscript(){ # Write contents of a simple python script template to stdout. curl -s 'https://dl.dropbox.com/s/n9ssyqb0ndbm32l/script.py?dl=1' } And this is really fun: pyscript | python - -h """ import os import sys import argparse def main(arguments): parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('infile', help = "A required input file", type = argparse.FileType('r')) parser.add_argument('outfile', help = "A required output file", type = argparse.FileType('w')) parser.add_argument('-a', '--abacad', help='An option') parser.add_argument('-b', '--blabacab', help = "Another option") args = parser.parse_args(arguments) if __name__ == '__main__': sys.exit(main(sys.argv[1:]))