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


Groups > comp.lang.python > #20557

Re: Python code file prototype

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'author:': 0.03; 'subject:Python': 0.05; 'inserts': 0.07; 'subject:code': 0.07; 'python': 0.08; '__name__': 0.09; 'received:mail- lpp01m010-f46.google.com': 0.09; 'am,': 0.12; 'subject:file': 0.13; "'__main__':": 0.16; '9:20': 0.16; 'main():': 0.16; '\xa0def': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'cheers,': 0.20; 'suggest': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; '\xa0if': 0.23; 'string': 0.24; 'cc:2**0': 0.26; 'there.': 0.27; 'message- id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.29; 'received:209.85.215.46': 0.32; 'fri,': 0.34; 'file': 0.34; '17,': 0.34; 'doc': 0.34; 'received:google.com': 0.37; 'received:209.85': 0.38; 'skip:\xa0 10': 0.39; 'received:209.85.215': 0.39; 'received:209': 0.39; 'might': 0.40; 'john': 0.61; 'purpose:': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=49JUpZM8oRidYhJG0yZGTMal0qVMERWB1ivOtlnXcGY=; b=Lsk5OK6JJbarZnJiFyF45duC+/nXovYVzHONtul3GngSBp67cbayg1zHbDwbu6tklc uCYmqvtdnq0k+jFWAvqGZnBqtvmG24Ctq22KCg2AiOYNSuIU/yEyFX1YaE/foYq2JccP pExWjyNc5JQZrJLjSbEud3d9cPbccnDy4VzH0=
MIME-Version 1.0
In-Reply-To <jhluol$63c$1@reader1.panix.com>
References <66ea0353-02ee-4152-947a-97b44ff3ec45@p7g2000yqk.googlegroups.com> <jhluol$63c$1@reader1.panix.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Fri, 17 Feb 2012 09:55:46 -0700
Subject Re: Python code file prototype
To John Gordon <gordon@panix.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5920.1329497777.27778.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1329497777 news.xs4all.nl 6897 [2001:888:2000:d::a6]:33338
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20557

Show key headers only | 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