Python code file prototype

Ian Kelly ian.g.kelly at gmail.com
Fri Feb 17 17:55:46 CET 2012


On Fri, Feb 17, 2012 at 9:20 AM, John Gordon <gordon at panix.com> wrote:
> Here's what PyScripter inserts in a new python file:
>
>  #---------------------------------------------------------------------
>  # Name:        module1
>  # Purpose:
>  #
>  # Author:      $USERNAME
>  #
>  # Created:     $DATE
>  # Copyright:   (c) $USERNAME $YEAR
>  # Licence:     <your licence>
>  #---------------------------------------------------------------------
>  #!/usr/bin/env python
>
>  def main():
>      pass
>
>  if __name__ == '__main__':
>      main()

The shebang has to be the first thing in the file to be useful.  As it
is above, it might as well not be there.  I would suggest also
including a doc string in the skeleton.

Cheers,
Ian



More information about the Python-list mailing list