Skip to content

Instantly share code, notes, and snippets.

@ArupSen
Created December 17, 2012 15:46
Show Gist options
  • Save ArupSen/4319301 to your computer and use it in GitHub Desktop.
Save ArupSen/4319301 to your computer and use it in GitHub Desktop.
Basic boilerplate for a python script file
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""[application description here]"""
def main():
pass
if __name__ == '__main__': main()
@JSkorpio05
Copy link

The first boilerplate line should specify which version of Python, and is missing the environment path. It should read:

#!/usr/bin/env python2

or

#!/usr/bin/env python3

Also, the if statement on line 8 goes against PEP 8 - multiple statements on one line. It should read:

if __name__ == '__main__':
    main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment