Re: Another question about JSON

2013-09-13 Thread Anthony Papillion
On 09/13/2013 08:24 AM, Peter Otten wrote: > Anthony Papillion wrote: > >> And I get a traceback that says: No JSON object could be decoded. The >> specific traceback is: >> >> Traceback (most recent call last): >> File "coinbase_bot.py", line 31, in >> getCurrentBitcoinPrice() >> File "c

Re: Another question about JSON

2013-09-13 Thread John Gordon
In Anthony Papillion writes: > I'm still working to get my head around JSON and I thought I'd done so > until I ran into this bit of trouble. I'm trying to work with the > CoinBase API. If I type this into my browser: > https://coinbase.com/api/v1/prices/buy > I get the following JSON returne

Re: Another question about JSON

2013-09-13 Thread Peter Otten
Anthony Papillion wrote: > Hello Again Everyone, > > I'm still working to get my head around JSON and I thought I'd done so > until I ran into this bit of trouble. I'm trying to work with the > CoinBase API. If I type this into my browser: > > https://coinbase.com/api/v1/prices/buy > > I get th

Another question about JSON

2013-09-13 Thread Anthony Papillion
Hello Again Everyone, I'm still working to get my head around JSON and I thought I'd done so until I ran into this bit of trouble. I'm trying to work with the CoinBase API. If I type this into my browser: https://coinbase.com/api/v1/prices/buy I get the following JSON returned {"subtotal":{"amo

Re: OK, I lied, I do have another question...

2011-07-11 Thread Chris Hulan
The callback is a method so you need to specify the owner builder.connect_signals({"on_window_destroy" : gtk.main_quit, "on_btnExit_clicked" : self.btnExit_clicked}) Got this info from http://www.pygtk.org/articles/pygtk-glade-gui/Creating_a_GUI_using_PyGTK_and_Glade.htm cheers -- http://mail.

OK, I lied, I do have another question...

2011-07-10 Thread Anthony Papillion
Hi Everyone, So I've used Glade to build a simple UI and I'm loading it with gtkBuilder. The UI loads fine but, for some reason, none of my signals are being connected. For example, in Glade, I said when the button called btnExit was clicked, execute the btnExit_clicked method. Then, in my App() c

Re: another question about classes and subclassing

2010-05-19 Thread cjw
On 18-May-10 17:51 PM, Alex Hall wrote: Hi again all, More about classes. I am still looking into my battleship game, and I will have several different craft. All craft have common attribs (position, alive, and so on) but each craft may be a surface ship, submarine, or airplane. All three are cra

Re: another question about classes and subclassing

2010-05-19 Thread Gregory Ewing
Dave Angel wrote: Inside the __init__() method of Submarine, simply call the __init__() method of Craft, with appropriate parameters. To elaborate on that a little, it looks like this: class Craft: def __init__(self, position): self.position = position class Submarine(Craft):

Re: another question about classes and subclassing

2010-05-19 Thread Gregory Ewing
Alex Hall wrote: So by calling submarine(craft) I am bringing in all of craft's attribs (subclassing)? Or does calling craft's __init__ method do that instead? By making Submarine a subclass of Craft, you are inheriting any methods, or other class attributes, defined in the classes themselves.

Re: another question about classes and subclassing

2010-05-19 Thread Gregory Ewing
Alex Hall wrote: Sorry, top-posting is a habit on some other lists I am on, and sometimes it follows me to lists where in-line posting is the way to do it. Which list you're on shouldn't matter. You should cultivate the habit of always quoting selectively and minimally, on any list. It may tak

Re: another question about classes and subclassing

2010-05-18 Thread Alex Hall
On 5/18/10, Dave Angel wrote: > Alex Hall wrote: >> Okay, that makes sense. So by calling submarine(craft) I am bringing >> in all of craft's attribs (subclassing)? Or does calling craft's >> __init__ method do that instead? Is there an advantage to doing it >> this way, rather than just making se

Re: another question about classes and subclassing

2010-05-18 Thread Dave Angel
Alex Hall wrote: Okay, that makes sense. So by calling submarine(craft) I am bringing in all of craft's attribs (subclassing)? Or does calling craft's __init__ method do that instead? Is there an advantage to doing it this way, rather than just making separate classes for everything, except for m

Re: another question about classes and subclassing

2010-05-18 Thread Alex Hall
Okay, that makes sense. So by calling submarine(craft) I am bringing in all of craft's attribs (subclassing)? Or does calling craft's __init__ method do that instead? Is there an advantage to doing it this way, rather than just making separate classes for everything, except for my own sense of orga

Re: another question about classes and subclassing

2010-05-18 Thread Dave Angel
Alex Hall wrote: Hi again all, More about classes. I am still looking into my battleship game, and I will have several different craft. All craft have common attribs (position, alive, and so on) but each craft may be a surface ship, submarine, or airplane. All three are craft, but a submarine can

another question about classes and subclassing

2010-05-18 Thread Alex Hall
Hi again all, More about classes. I am still looking into my battleship game, and I will have several different craft. All craft have common attribs (position, alive, and so on) but each craft may be a surface ship, submarine, or airplane. All three are craft, but a submarine can be submerged or no

Re: Yet another question about class property.

2009-05-20 Thread Dave Angel
Jim Qiu wrote: Thanks for you patience, Dave. Obviously i have not got used to the python philosophy. Following you guide, i implemented the following code, and you are absolutely right. #!/usr/bin/python #coding:utf-8 class Parent(object): def __init__(self): pass def displayAttrOfSubClass(

Re: Yet another question about class property.

2009-05-20 Thread Jim Qiu
Thanks for you patience, Dave. Obviously i have not got used to the python philosophy. Following you guide, i implemented the following code, and you are absolutely right. #!/usr/bin/python #coding:utf-8 class Parent(object): def __init__(self): pass def displayAttrOfSubClass(self): print self

Re: Yet another question about class property.

2009-05-20 Thread Dave Angel
Jim Qiu wrote: Hi everyone, Following is the code i am reading, i don't see anywhere the declaration of Message.root object, Where is it from? #bots-modules import bots.botslib as botslib import bots.node as node from bots.botsconfig import * class Message(object): ''' abstract class; rep

Re: Yet another question about class property.

2009-05-20 Thread Mike Kazantsev
Jim Qiu wrote: > Hi everyone, > > Following is the code i am reading, i don't see anywhere the declaration of > Message.root object, > Where is it from? ... Prehaps it gets assigned by the parent itself? Like this: def spawn_child(self): child = Message() child.root = self -- Mike Ka

Yet another question about class property.

2009-05-20 Thread Jim Qiu
Hi everyone, Following is the code i am reading, i don't see anywhere the declaration of Message.root object, Where is it from? #bots-modules import bots.botslib as botslib import bots.node as node from bots.botsconfig import * class Message(object): ''' abstract class; represents a edi mes

Re: Another Question

2008-05-24 Thread Gandalf
On May 23, 10:47 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On May 23, 1:44 pm, Gandalf <[EMAIL PROTECTED]> wrote: > > > you've been very helpful but still i have only one problem. I wont the > > window not to be close after clicking the X button. > > I wont the program to stay on the toolbar >

Re: Another Question

2008-05-23 Thread Mike Driscoll
On May 23, 1:44 pm, Gandalf <[EMAIL PROTECTED]> wrote: > you've been very helpful but still i have only one problem. I wont the > window not to be close after clicking the X button. > I wont the program to stay on the toolbar > > thanks! Well then, in your event handler, just don't do anything. d

Re: Another Question

2008-05-23 Thread Gandalf
you've been very helpful but still i have only one problem. I wont the window not to be close after clicking the X button. I wont the program to stay on the toolbar thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Another Question

2008-05-23 Thread Mike Driscoll
On May 23, 12:02 pm, Gandalf <[EMAIL PROTECTED]> wrote: > On May 23, 6:25 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > > > > On May 23, 10:45 am, Gandalf <[EMAIL PROTECTED]> wrote: > > > > How can i bind function that handle the mouse clicking  window X event > > > or clicking alt+F4 > > > > th

Re: Another Question

2008-05-23 Thread Gandalf
On May 23, 6:25 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On May 23, 10:45 am, Gandalf <[EMAIL PROTECTED]> wrote: > > > How can i bind function that handle the mouse clicking window X event > > or clicking alt+F4 > > > thanks > > You really need to learn to ask good questions. Unless people d

Re: Another Question

2008-05-23 Thread Mike Driscoll
On May 23, 10:45 am, Gandalf <[EMAIL PROTECTED]> wrote: > How can i bind function that handle the mouse clicking  window X event > or clicking alt+F4 > > thanks You really need to learn to ask good questions. Unless people dive into your previous posts, they won't know what Python GUI toolkit you

Another Question

2008-05-23 Thread Gandalf
How can i bind function that handle the mouse clicking window X event or clicking alt+F4 thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Another question about variable args.

2007-08-07 Thread Neil Cerutti
On 2007-08-07, Steven W. Orr <[EMAIL PROTECTED]> wrote: > I have a structure I need to pack. I call struct.pack about a dozen times > and each call takes about 53 arguments. > > I create a sequence of the arguments: > a1 = 1 > a2 = 2 > a3 = 3 > etc... > a54 = 88 > myseq = (a1, a2, a3, a4 etc... a5

Another question about variable args.

2007-08-07 Thread Steven W. Orr
I have a structure I need to pack. I call struct.pack about a dozen times and each call takes about 53 arguments. I create a sequence of the arguments: a1 = 1 a2 = 2 a3 = 3 etc... a54 = 88 myseq = (a1, a2, a3, a4 etc... a53) Also I made def mpack ( fmt, *ss ): print type(ss) for ii in

Re: another question about buffers

2006-04-22 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >i think it may be, Moral: don't use arbitrary values as booleans. -- http://mail.python.org/mailman/listinfo/python-list

Re: another question about buffers

2006-04-22 Thread nephish
i think it may be, i am just doing a while 1: loop to just wait for whatever comes in. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: another question about buffers

2006-04-22 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: >databack = sockobj.recv(1028) >if databack: > print 'caught a message %s bytes ' % len(databack) >else: > print 'fail to recieve data from server' > >the output in the terminal runs fine until it fails to get the >databack, it

another question about buffers

2006-04-21 Thread nephish
lo there all ! i finally got my script to receive info on a socket. but i need to somehow set up a loop that will continue to listen for more info comming across the same socket. the way it works is, i log in with a login and password, it shoots back an acknowlagement, then i send a request for d