Re: Accessors in Python (getters and setters)

2006-07-14 Thread riquito
mystilleef ha scritto: > Methods are used to perform actions. Data attributes usually aren't. We > are on different planes. You aren't thinking pythonic. You should not make any difference between accessing an attribute and accessing a function. They both just need to receive the right data to p

Re: Depricated String Functions in Python

2006-07-20 Thread riquito
Steve Holden ha scritto: > Anoop wrote: > > Thanks Stefen > > > > let me be more specific how would i have to write the following > > function in the deprecated format > > > > map(string.lower,list) > > > To avoid the deprecated usage you would use the unbound method of the > str type (that's the

prog1 | prog2 . How not to make prog2 block if not piped?

2006-06-14 Thread riquito
I googled around, but couldn't understand how to solve this problem. I have 2 scripts # script1.py # print 'something' #script2.py x=sys.stdin.read() print 'passed' if I run script1.py | script2.py all goes well. But if I run just script2.py the program blocks waiting forever for input. On *ni

Re: prog1 | prog2 . How not to make prog2 block if not piped?

2006-06-14 Thread riquito
imcs ee ha scritto: > do u really need read something even when you run the scripts2.py directly? > why not just change script2.py to > #script2.py > if __name__ == "__main__": > x=sys.stdin.read() > print 'passed' > else: > print 'passed from else branch' > > is it what you want? o

Re: prog1 | prog2 . How not to make prog2 block if not piped?

2006-06-14 Thread riquito
Steve Holden ha scritto: > When you run it "standalone" you should give it some input - type some > text then enter ^D (on Unix-like systems) or ^Z (on Windows). How else > do you expect read() to return anything? It *has* to read to the end fo > the file before it returns a value. > > regards >

Re: PyGTK and Py2Exe troubles

2006-06-24 Thread riquito
Tim N. van der Leeuw ha scritto: > I tried to create a windows executable of a pygtk program. My first > attempt worked, kinda, except that no themes were applied and no > readable fonts were found by pango; so all letters where just empty > squares. But the program worked. > > I looked up some d