sairam wrote:
I have some local variables defined in one method and Can I make those
variables as global variables? If so , can any one explain me how can
I do that


Thanks,
Sairam

See: http://www.faqs.org/docs/diveintopython/dialect_locals.html

When a line of code asks for the value of a variable x, Python will search for that variable in all the available namespaces, in order:

  1. local namespace - specific to the current function or class
     method. If the function defines a local variable x, or has an
     argument x, Python will use this and stop searching.
  2. global namespace - specific to the current module. If the module
     has defined a variable, function, or class called x, Python will
     use that and stop searching.
  3. built-in namespace - global to all modules. As a last resort,
     Python will assume that x is the name of built-in function or
     variable.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to