Troubles with global variables

Dale Strickland-Clark dale at riverhall.NOSPAMco.uk
Mon Oct 15 10:51:32 EDT 2001


Jeremy Whetzel <lists at toadmail.com> wrote:

>Janko Hauser <jhauser at ifm.uni-kiel.de> writes:
>
>> Perhaps something else is wrong
>
>That has to be the case.  I just can't figure out, for the life of me,
>why this is happening, though.  I greatly reduced my code to show here.
>It's still doing the same thing (not updating the variables when the
>menu is refreshed)
>
>
>import os
>import sys
>import string
>
>enc = 'gogo'
>br = '128'
>
>eo = [['E',') Encoder: ','chooseenc()',enc],
>      ['B',') Bitrate: ','choosebr()',br]]

                                       ^^^^ 
Your problem, I think, is here.

The values of enc and br are taken at the time eo is built. If you
want new values, you will need to re-assign eo or use an alternative
approach.


--
Dale Strickland-Clark
Riverhall Systems Ltd



More information about the Python-list mailing list