[Tutor] Comments appreciated

Luis N tegmine at gmail.com
Wed Dec 29 21:51:29 CET 2004


> [Jeff]
> > Also, even though this is intended to be a quick shell script, it's
> > not a bad idea to make everything except function defs into a little
> > main() function, and call it in a script-only section.
> 
> 
> [Luis]
> 
> > The only thing I'm not clear about is how 'trashcan' can be a
> > local variable inside main() when it's required by both trash() and
> > can()
> 
> 
> What Jeff is trying to say is that it's possible to pass 'trashcan' around
> as yet another parameter to both trash() and can().  That is, we can avoid
> global variables altogether, and just work with parameter passing.
> 

Lovely, thank you. I started a project that is for learning spanish
on-line, of currently 300 lines or so, that is proceeding rapidly
thanks to these lessons learned. Thank you Python Tutors, and thank
you Python!

Cheers,

Luis


More information about the Tutor mailing list