Re: Variable scoping rules in Python?

2007-10-08 Thread MRAB
On Oct 8, 4:06 pm, Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > > > Ok, I'm relatively new to Python (coming from C, C++ and Java). I'm > > working on a program that outputs text that may be arbitrarily long, > > but should still line up, so I want to split the output on a specific

Re: Variable scoping rules in Python?

2007-10-08 Thread Paul Hankin
On Oct 8, 3:17 pm, [EMAIL PROTECTED] wrote: > Ok, I'm relatively new to Python (coming from C, C++ and Java). I'm > working on a program that outputs text that may be arbitrarily long, > but should still line up, so I want to split the output on a specific > column boundary. Since I might want to

Re: Variable scoping rules in Python?

2007-10-08 Thread Steven D'Aprano
On Mon, 08 Oct 2007 07:17:36 -0700, joshua.davies wrote: > I went back and re-read chapter 13 of "Learning Python", which talks > about variable scoping rules, and I can't figure out why Python is > saying this variable in Unbound. It works if I insert: > > global COLUMNS > > before the "if"

[OT] Re: Variable scoping rules in Python?

2007-10-08 Thread Peter Otten
joshua.davies wrote: > Ok, I'm relatively new to Python (coming from C, C++ and Java). I'm > working on a program that outputs text that may be arbitrarily long, > but should still line up, so I want to split the output on a specific > column boundary. Since I might want to change the length of

Re: Variable scoping rules in Python?

2007-10-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Ok, I'm relatively new to Python (coming from C, C++ and Java). I'm > working on a program that outputs text that may be arbitrarily long, > but should still line up, so I want to split the output on a specific > column boundary. FWIW : http://docs.python.org/lib/mod

Re: Variable scoping rules in Python?

2007-10-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Ok, I'm relatively new to Python (coming from C, C++ and Java). I'm > working on a program that outputs text that may be arbitrarily long, > but should still line up, so I want to split the output on a specific > column boundary. Since I might want to change the lengt

Variable scoping rules in Python?

2007-10-08 Thread joshua . davies
Ok, I'm relatively new to Python (coming from C, C++ and Java). I'm working on a program that outputs text that may be arbitrarily long, but should still line up, so I want to split the output on a specific column boundary. Since I might want to change the length of a column, I tried defining the