Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20557

Re: Python code file prototype

References <66ea0353-02ee-4152-947a-97b44ff3ec45@p7g2000yqk.googlegroups.com> <jhluol$63c$1@reader1.panix.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2012-02-17 09:55 -0700
Subject Re: Python code file prototype
Newsgroups comp.lang.python
Message-ID <mailman.5920.1329497777.27778.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Feb 17, 2012 at 9:20 AM, John Gordon <gordon@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python code file prototype Bruce Eckel <lists.eckel@gmail.com> - 2012-02-17 07:35 -0800
  Re: Python code file prototype John Gordon <gordon@panix.com> - 2012-02-17 16:20 +0000
    Re: Python code file prototype Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-17 09:55 -0700
    Re: Python code file prototype Grant Edwards <invalid@invalid.invalid> - 2012-02-17 17:02 +0000
    Re: Python code file prototype Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-02-17 12:56 -0500
      Re: Python code file prototype Bruce Eckel <lists.eckel@gmail.com> - 2012-02-17 11:03 -0800
      Re: Python code file prototype Grant Edwards <invalid@invalid.invalid> - 2012-02-18 15:25 +0000

csiph-web