On 07/16/2010 06:01 PM, Ray wrote: > if __name__=='__main__': > for x in range(10): > x=Test() > """ > the question is how do i call x.value outside of that for loop? > something like > print x.value ? > """
You would have to keep references to your Test objects (untested code): if __name__ == '__main__': test_objects = [] for x in range(10): test_objects[x] = Test() print test_objects[0].value ... You may want to rewrite this as a list comprehension if __name__ == '__main__': test_objects = [Test() for i in range(10)] print test_objects[0].value Andre -- http://mail.python.org/mailman/listinfo/python-list