francisl <[EMAIL PROTECTED]> wrote:
>
>I have a problem when I declare global variable.
>If it is string, dict, array or tuple, everything goes fine, but with int, I 
>get an "used before declaration" error.

Excuse me for being dubious, but I don't believe you.  Both of the examples
you posted work fine in Python 2.3 on Windows XP.  Please type the EXACT
script you ran, and show us the EXACT error message you get.  You can
cut-and-paste from the cmd shell script to make sure we see the right
output.

>here a sample :
>
>vardict = {'un':1, 'deux':2}
>
>def print_value():
>       print vardict['un']
>######### ok, that works
>
>--------------------
>
>#!/bin/python
>varint = 1
>
>def print_value():
>       print varint
>######### ok, that failed
>
>python 2.3.4 - windows2000
>
>(it works in linux!)
-- 
- Tim Roberts, [EMAIL PROTECTED]
  Providenza & Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to