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


Groups > comp.lang.python > #16423

RE: Total newbie question: Best practice

From Shambhu Rajak <Shambhu.Rajak@kpitcummins.com>
Subject RE: Total newbie question: Best practice
Date 2011-11-30 08:50 +0000
References <jb3e06$37h$1@dont-email.me>
Newsgroups comp.lang.python
Message-ID <mailman.3149.1322643933.27778.python-list@python.org> (permalink)

Show all headers | 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