[Tutor] question about importing threads

shawn bright nephish at gmail.com
Sun Dec 31 15:46:15 CET 2006


Thanks, Alan.
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.

shawn

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
> modules.
>
> 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.
>
> FWIW
>
> 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
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061231/70b981a7/attachment.html 


More information about the Tutor mailing list