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
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
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
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
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
>
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