[Python] Problema di scope, o bug?

2008-08-30 Per discussione Andrea Gasparini
Ciao! Qualcuno mi spiega come e' possibile che questo script: 1 #!/usr/bin/python 2 import sys 3 import getopt 4 5 quiet = False 6 7 def main(): 8 print quiet 9 optlist, args = getopt.getopt(sys.argv[1:], 'q', ['--quiet']) 10 11 for o,a in optlist: 12 if o in ('-q',

Re: [Python] Problema di scope, o bug?

2008-08-30 Per discussione Manlio Perillo
Andrea Gasparini ha scritto: > Ciao! > Qualcuno mi spiega come e' possibile che questo script: > > 1 #!/usr/bin/python > 2 import sys > 3 import getopt > 4 > 5 quiet = False > 6 > 7 def main(): > 8 print quiet > 9 optlist, args = getopt.getopt(sys.argv[1:], 'q', ['--quiet']) > 1

Re: [Python] Problema di scope, o bug?

2008-08-30 Per discussione Manlio Perillo
Manlio Perillo ha scritto: > Andrea Gasparini ha scritto: >> Ciao! >> Qualcuno mi spiega come e' possibile che questo script: >> >> 1 #!/usr/bin/python >> 2 import sys >> 3 import getopt >> 4 >> 5 quiet = False >> 6 >> 7 def main(): >> 8 print quiet >> 9 optlist, args = getopt.ge