variable scope

2009-09-25 Thread Joel Juvenal Rivera Rivera
Hi i was playing around with my code the i realize of this ### _uno__a = 1 class uno(): __a = 2 def __init__(self): print __a uno() ### and prints 1 So when i create class uno in the __init__ calls the global _uno__a when i refer just __a ? it's

Re: variable scope

2009-09-25 Thread Joel Juvenal Rivera Rivera
Yeah i forgot the self an try the code then i see an error that it was not defines _uno__a so that's where i define the global and see that behavior. Thanks for your answers El vie, 25-09-2009 a las 15:14 -0700, Ethan Furman escribió: Joel Juvenal Rivera Rivera wrote: Hi i was playing around

create shell history with python

2009-08-11 Thread Joel Juvenal Rivera Rivera
I been thinking how to make a 'bash like history shell' in python, i don't know if with stdin and stdout i can accomplish this or do i need something like curses and stuff like that, anyway im start to figure this out. Does any body has try this? or have any interesting idea? --Joel Rivera --

Re: create shell history with python

2009-08-11 Thread Joel Juvenal Rivera Rivera
Wow i didn't know that module this solves everything... i guess python has a lot more batteries than i thought . Thank you Chris El mar, 11-08-2009 a las 18:15 -0400, Chris Rebert escribió: On Tue, Aug 11, 2009 at 6:09 PM, Joel Juvenal Rivera Riverajoel...@gmail.com wrote: I been thinking

Any idea to emulate tail -f

2009-05-04 Thread Joel Juvenal Rivera Rivera
I want to make something very similar to the command tail -f (follow a file), i have been trying with some while True and some microsleeps (about .1 s); did someone has already done something like this? And about the file is the apache acceslog of a site with a lot of traffic. Regards