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

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

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

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

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