Re: TkInter bind() event is not firing event trigger

2010-06-22 Thread MRAB
Anthony Papillion wrote: So I want to execute some code when the user double clicks an item in a ListBox. The documentation says I should use the listbox.bind() method, specifying the Double-l event to detect the double left mouse button click. My code is this: gsItems = Listbox(root, width=76,

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Gregory Ewing
Thomas Jollans wrote: "Everything is an object" in both languages, or so they say. That's really a meaningless statement, because it depends on what you count as a "thing". But there is at least one thing that is an object in Python but not in Ruby. There are no stand-alone functions in Ruby,

Re: TkInter bind() event is not firing event trigger

2010-06-22 Thread rantingrick
On Jun 22, 7:21 pm, Anthony Papillion wrote: > I've also removed the (event) parameter just in case and tried it and > it makes no difference. What am I doing wrong here? Well don't remove the event parameter because Tkinter will pass it every time since this is an EVENT! Here is some code to pl

Re: Book review / advise

2010-06-22 Thread alex23
John Bokma wrote: > Now let's hope that your asshat behaviour doesn't stop companies like > this to continue to print those books. I have considered to buy the > complete set a few times. And I hope you're not calling me naive... Given the current propensity for people to scrape web sites like Wi

Re: TkInter bind() event is not firing event trigger

2010-06-22 Thread rantingrick
On Jun 22, 7:39 pm, MRAB wrote: > http://www.pythonware.com/library/tkinter/introduction/events-and-bin... > > it's ''. Yes and i vehemently hate these names! Just hideous if you ask me. @ Anthony Also be sure to use an "event name" for an event function/method and use the docstring to describe

Re: Why 'open' is not a function according to inspect module?

2010-06-22 Thread Mel
Peng Yu wrote: > Hi, > > 'open' is not a function according to inspect module. But according to > help(open), it is a function. Is there something wrong with inspect > module? > > $ cat main.py > #!/usr/bin/env python > > import inspect > > def hello(): > print "Hello World!" > return > >

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
On 6/22/10 1:09 PM, John Bokma wrote: > Now let's hope that your asshat behaviour doesn't stop companies like > this to continue to print those books. I have considered to buy the > complete set a few times. And I hope you're not calling me naive... Excuse me? I *have* seen people burned by confu

Re: Changing the Emacs engine to Guile

2010-06-22 Thread nanothermite911fbibustards
Very EDUCATIONAL VIDEO http://www.youtube.com/watch?v=wzr_hRsSuGM&feature=related On Jun 22, 1:40 pm, Cecil Westerhof wrote: > Op dinsdag 22 jun 2010 19:28 CEST schreef Pascal J. Bourguignon: > > > > >>> this (while (re-search-forward ...)) loop modifies the line for each > >>> occurence of the r

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread rantingrick
On Jun 22, 7:56 pm, Gregory Ewing wrote: > Thomas Jollans wrote: > > "Everything is an object" in both languages, or so they say. > > That's really a meaningless statement, because it depends on > what you count as a "thing". But there is at least one thing > that is an object in Python but not in

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread MRAB
rantingrick wrote: On Jun 22, 7:56 pm, Gregory Ewing wrote: Thomas Jollans wrote: "Everything is an object" in both languages, or so they say. That's really a meaningless statement, because it depends on what you count as a "thing". But there is at least one thing that is an object in Python

Strange factory pattern

2010-06-22 Thread Zac Burns
In the threading module there are several code bits following this convention: ### def Class(*args, **kwargs): return _Class(*args, **kwargs) class _Class(... ### This is true for Event, RLock, and others. Why do this? It seems to violate the rule of least astonishment (isinstance(Event(),

"isinstance" question

2010-06-22 Thread John Nagle
I want to test whether an object is an instance of any user-defined class. "isinstance" is less helpful than one would expect. >>> import types >>> class foo() : # define dummy class ... pass ... >>> x = foo() >>> >>> type(x) >>> >>> isinstance(x, types.ClassType) False >>> isinstance(x,

Re: "isinstance" question

2010-06-22 Thread Ben Finney
John Nagle writes: > I want to test whether an object is an instance of any user-defined > class. "isinstance" is less helpful than one would expect. Right. The type hierarchy is now unified; there's essentially no difference in later Python versions between user-defined types and built-in ty

Re: Strange factory pattern

2010-06-22 Thread Gerry Reno
This looks like a public class exposing an implementation private class.Jun 22, 2010 10:39:05 PM, zac...@gmail.com wrote:In the threading module there are several code bits following this convention:###def Class(*args, **kwargs):    return _Class(*args, **kwargs)class _Class(...###This is true for

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread rantingrick
On Jun 22, 9:31 pm, MRAB wrote: > [snip] > Napoleon once said "Never interrupt your enemy when he is making a > mistake."! :-) And how exactly does your example express itself in a more "syntactically-correct" "linear-flow" than the two code snippets i provided earlier, hmmm? PS: Oh yes i do kn

Jew JUDGE shows off JEW POWER by BULLYING and BLACKMAILING a BLACK PRESIDENT OBAMA

2010-06-22 Thread small Pox
Jew Judges NEVER came out against the CRIMES of BUSH and CHENEY and LARRYS I L V E RS T E I N - The main player in 911 Jews are coming out from the directions of Corporations, Mafias, Legislators, and now Judge to SUBVERT the UNITED STATES. Please listen to the Speech of Mr Benjamin H

Re: "isinstance" question

2010-06-22 Thread John Nagle
On 6/22/2010 8:13 PM, Ben Finney wrote: John Nagle writes: I want to test whether an object is an instance of any user-defined class. "isinstance" is less helpful than one would expect. Right. The type hierarchy is now unified; there's essentially no difference in later Python versions b

P= /V:P == 2P*V because fist '/V' is actually '/' divided by 'V'comp.language.python.brood of vipers! Look! I got it, Gus! I got it! Look: P= /V:P == 2P*V because fist '/V' is actually '/' div

2010-06-22 Thread sci.math
I got it, Gus! I got it! Look: P= /V:P == 2P*V because fist '/V' is actually '/' divided by 'V' P= /V:P == 2P*V because fist '/V' is actually '/' divided by 'V' P= /V:P == 2P*V because fist '/V' is actually '/' divided by 'V' P= /V:P == 2P*V because fist '/V' is actually '/' divided by

Re: Book review / advise

2010-06-22 Thread John Bokma
Stephen Hansen writes: > I *have* seen people burned by confusion over situations *extremely* > similar to this; But is it? You didn't even ask yourself that question. > If being concerned about fellow Python-folks possibly getting ripped off > makes me an asshat, so be it. Go y'know-what yours

Re: Book review / advise

2010-06-22 Thread John Bokma
alex23 writes: > John Bokma wrote: >> Now let's hope that your asshat behaviour doesn't stop companies like >> this to continue to print those books. I have considered to buy the >> complete set a few times. And I hope you're not calling me naive... > > Given the current propensity for people to

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread David Cournapeau
On Tue, Jun 22, 2010 at 5:58 PM, Josef Tupag wrote: > I've been programming (when I do program) mainly in Perl for the last 10 > years or so. But I've been itching to learn a new language for a while now, > and the two near the top of the list are Ruby and Python. > > I figure that Ruby would be e

Re: "isinstance" question

2010-06-22 Thread Gabriel Genellina
En Tue, 22 Jun 2010 23:45:07 -0300, John Nagle escribió: I want to test whether an object is an instance of any user-defined class. "isinstance" is less helpful than one would expect. >>> import types >>> class foo() : # define dummy class ... pass ... >>> x = foo() >>> >>> type

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
On 6/22/10 9:48 PM, John Bokma wrote: > alex23 writes: >> Given the current propensity for people to scrape web sites like >> Wikipedia and publish them on Amazon without the rights holders' >> consent, > > Can you explain were exactly it states that you can't print a book out > of wikipedia arti

Re: Strange factory pattern

2010-06-22 Thread Gabriel Genellina
En Tue, 22 Jun 2010 23:33:55 -0300, Zac Burns escribió: In the threading module there are several code bits following this convention: ### def Class(*args, **kwargs): return _Class(*args, **kwargs) class _Class(... ### This is true for Event, RLock, and others. Why do this? It seems to

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
On 6/22/10 10:39 PM, Dennis Lee Bieber wrote: > On Tue, 22 Jun 2010 15:55:51 -0700, Stephen Hansen > declaimed the following in > gmane.comp.python.general: > >> I second Forth. Learning and using that was -- slightly painful, but > > Just pick up any advanced HP programmable calculator...

Re: Using Unicode file names with ftplib and encodings.idna as a workaround?

2010-06-22 Thread Gabriel Genellina
En Tue, 22 Jun 2010 11:43:34 -0300, escribió: Python 2.6.5 (Win32): Is there a work around for ftplib's (and ftputil's) apparent inability to support Unicode file names? I'm thinking that I might be able to use the encodings.idna as a work around for this? According to RFC 2640, you should u

Re: "isinstance" question

2010-06-22 Thread Satish Eerpini
> >I want to test whether an object is an instance of any user-defined >> class. "isinstance" is less helpful than one would expect. >> >> >>> import types >> >>> class foo() : # define dummy class >> ... pass >> ... >> >>> x = foo() >> >>> >> >>> type(x) >> >> >>> >> >>> isinstanc

[Germany / München] Munich Python User Grou p Meeting this thursday!

2010-06-22 Thread Stefan Behnel
Hi, sorry for choosing this forum for a regional announcement - just hoping to attract some local users who don't read the local mailing list. After a while of silence, there will be a meeting of the µPy (Münchner Python User Group) this thursday (June 24th). See here for further informatio

<    1   2