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


Groups > comp.lang.python > #16423

RE: Total newbie question: Best practice

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news-transit.tcx.org.uk!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <Shambhu.Rajak@kpitcummins.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'newbie': 0.03; 'main()': 0.05; 'question:': 0.07; 'python': 0.08; 'scripts': 0.09; 'message-----': 0.12; 'to:name:python-list@python.org': 0.15; '(do': 0.16; 'from:addr:kpitcummins.com': 0.16; 'from:addr:shambhu.rajak': 0.16; 'from:name:shambhu rajak': 0.16; 'intended.': 0.16; 'practice?': 0.16; 'received:kpit.com': 0.16; 'shambhu': 0.16; 'subject:question': 0.17; '(which': 0.19; 'seems': 0.20; 'to:2**1': 0.21; "doesn't": 0.22; 'header:In-Reply- To:1': 0.22; 'collins': 0.23; 'function': 0.27; 'coding': 0.28; 'depends': 0.28; 'work.': 0.28; 'script': 0.28; 'thanks': 0.31; 'quite': 0.32; 'hi,': 0.32; 'done': 0.34; 'to:addr:python-list': 0.34; 'subject:': 0.34; 'received:169': 0.34; 'received:169.254': 0.34; 'end.': 0.34; 'however,': 0.36; 'starting': 0.36; 'header:Received:8': 0.36; 'sent:': 0.36; 'beginning': 0.36; 'but': 0.37; 'i.e.': 0.39; 'programming.': 0.39; 'from:': 0.39; 'to:addr:python.org': 0.40; 'matter': 0.61; 'total': 0.61; 'your': 0.61; 'results': 0.63; 'bear': 0.64; 'for).': 0.91; 'subject:Best': 0.93
X-SpamScore -11
X-BigFish VPS-11(zzbb2dK9371K542Mzz1202hzz8275dhz2dh2a8h668h839h8e2h8e3h93fh61h)
X-Spam-TCS-SCL 0:0
X-Forefront-Antispam-Report CIP:220.225.38.51; KIP:(null); UIP:(null); IPV:NLI; H:Outbound.kpitcummins.com; RD:none; EFVD:NLI
From Shambhu Rajak <Shambhu.Rajak@kpitcummins.com>
To Colin Higwell <colinh@somewhere.invalid>, "python-list@python.org" <python-list@python.org>
Subject RE: Total newbie question: Best practice
Thread-Topic Total newbie question: Best practice
Thread-Index AQHMrvJeGVNGbOf2Pkeh7vm3zIvGwZXFGxnA
Date Wed, 30 Nov 2011 08:50:19 +0000
References <jb3e06$37h$1@dont-email.me>
In-Reply-To <jb3e06$37h$1@dont-email.me>
Accept-Language en-US, en-IN
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [10.10.69.41]
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
MIME-Version 1.0
X-OriginatorOrg kpitcummins.com
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.3149.1322643933.27778.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1322643934 news.xs4all.nl 6916 [2001:888:2000:d::a6]:52094
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:16423

Show key headers only | View raw


Collins Congratulations for your first step into Python Programming.
You can call them script or programs(not necessarily but depends on what your coding for).
Yaa..it's always a good practice to call it through main(), but it doesn't really matter you 
can call the method in way....  

Regards,
Shambhu

-----Original Message-----
From: Colin Higwell [mailto:colinh@somewhere.invalid] 
Sent: 30/11/2011 1:37 AM
To: python-list@python.org
Subject: Total newbie question: Best practice

Hi,

I am just starting to learn Python (I have been at it only a few hours), 
so please bear with me. I have a few very small scripts (do you call them 
scripts or programs?) which work properly, and produce the results 
intended.

However, they are monolithic in nature; i.e. they begin at the beginning 
and finish at the end. Having done a little reading, I note that it seems 
to be quite common to have a function main() at the start (which in turn 
calls other functions as appropriate), and then to call main() to do the 
work. 

Is that standard best practice?

Thanks




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


Thread

Total newbie question: Best practice Colin Higwell <colinh@somewhere.invalid> - 2011-11-29 20:06 +0000
  Re: Total newbie question: Best practice Arnaud Delobelle <arnodel@gmail.com> - 2011-11-29 20:34 +0000
    Re: Total newbie question: Best practice Neil Cerutti <neilc@norwich.edu> - 2011-11-29 21:12 +0000
  Re: Total newbie question: Best practice Chris Angelico <rosuav@gmail.com> - 2011-11-30 07:36 +1100
  Re: Total newbie question: Best practice Dave Angel <d@davea.name> - 2011-11-29 16:57 -0500
    Re: Total newbie question: Best practice Colin Higwell <colinh@somewhere.invalid> - 2011-11-29 23:08 +0000
  RE: Total newbie question: Best practice Shambhu Rajak <Shambhu.Rajak@kpitcummins.com> - 2011-11-30 08:50 +0000
  Re: Total newbie question: Best practice "Pedro Henrique G. Souto" <pedro.h.souto@gmail.com> - 2011-11-30 09:36 -0200

csiph-web