[Tutor] question about importing threads
nephish at gmail.com
Sun Dec 31 15:46:15 CET 2006
Yes, the thing is getting to be a pain to deal with at this size, i am
in-process of splitting out the classes into their own files.
Thanks for your help.
On 12/30/06, Alan Gauld <alan.gauld at btinternet.com> wrote:
> "shawn bright" <nephish at gmail.com> wrote i
> > testing this right away. This long a .py script is becomming a
> > headache and
> > i think it will be easier by far if it is pulled apart somewhat.
> As a general rule of thumb, any Python script (or any programming
> language file for that matter!) that gets longer than 4 or 5 hundred
> lines should be looked at closely in terms of splitting it into
> There are a few (very few) times where I've seen a thousand line
> file that was justified, but nearly any time you get beyond 500
> lines you should be splitting things up - especially in high level
> languages like Python where the methods/functions tend to be
> short anyway.
> A quick check of the Python standard library shows the
> average file size there to be: 459 lines(*) And that's pretty
> high IMHO!
> There are 19 files over a thousand lines and the biggest file
> is over 3000 lines... which seems way too big to me!
> But that's out of 188 files...
> Cygwin; Python 2.4
> In case you want to repeat for your version I used:
> >>> libs = [len(open(f).readlines()) for f in glob('*.py')]
> >>> print sum(libs)/len(libs)
> >>> print max(libs)
> >>> print len([s for s in libs if s>1000])
> Alan G
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor