Re: [Tutor] validating decimal class

2008-11-05 Thread John Fouhy
2008/11/6 Brian Lane <[EMAIL PROTECTED]>: > But you could also compare it to a known type: > > if not type(price) is type(decimal.Decimal(0)): > print "Not Decimal" Easier to just compare with decimal.Decimal: >>> import decimal >>> d = decimal.Decimal(13) >>> type(d) == decimal.Decimal True --

Re: [Tutor] using rect.inflate()

2008-11-05 Thread John Fouhy
2008/11/6 Christopher Spears <[EMAIL PROTECTED]>: > I inserted this code snippet into the Spaceship class: > > self.rect = self.image.get_rect() > print self.rect > self.rect = self.rect.inflate(-50, -50) > print self.rect > > The following was printed to my console: > > > > > > I'm assuming that t

Re: [Tutor] validating decimal class

2008-11-05 Thread Brian Lane
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: > hello > silly question, but i can't seem to figure it it. > > I have an object which is: > type(price) > > > but i can't figure how to validate against it. > if not isinstance(price, decimal.Decimal): >

Re: [Tutor] validating decimal class

2008-11-05 Thread Kent Johnson
On Wed, Nov 5, 2008 at 7:09 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have an object which is: > type(price) > > > but i can't figure how to validate against it. > if not isinstance(price, decimal.Decimal): > do something... This should work, what problem are you havi

[Tutor] using rect.inflate()

2008-11-05 Thread Christopher Spears
I'm modifying a game for an assignment in "Game Programming" by Andy Harris. I'm not reading this book as part of a class. Basically, I turned one of the example games into an Asteroid rip off. However, I didn't like the collisions between the spaceship and the asteroids, so I decided to shri

[Tutor] validating decimal class

2008-11-05 Thread [EMAIL PROTECTED]
hello silly question, but i can't seem to figure it it. I have an object which is: >>> type(price) but i can't figure how to validate against it. >>>if not isinstance(price, decimal.Decimal): do something... how do i ensure that the object 'price' is a decimal? thanks

Re: [Tutor] Building RSS reader with Python

2008-11-05 Thread Kent Johnson
On Wed, Nov 5, 2008 at 3:36 PM, <[EMAIL PROTECTED]> wrote: > Might look at rss2email, it works very well for those of us that like > to read email instead of yet another website to read rss feeds. > > It won't solve your "search for the address of rss feeds on the site" > but it will give you an i

Re: [Tutor] Building RSS reader with Python

2008-11-05 Thread Kent Johnson
On Wed, Nov 5, 2008 at 3:26 PM, <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm new to programming and am building a very basic rss reader for my first > major project with python and GUI. As it is, I have it set up so that if I > input an exact rss feed address (ex http://news.google.com/?outpu

Re: [Tutor] Building RSS reader with Python

2008-11-05 Thread Shawn Milochik
On Wed, Nov 5, 2008 at 3:26 PM, <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm new to programming and am building a very basic rss reader for my first > major project with python and GUI. As it is, I have it set up so that if I > input an exact rss feed address (ex http://news.google.com/?outpu

Re: [Tutor] Building RSS reader with Python

2008-11-05 Thread lister
Might look at rss2email, it works very well for those of us that like to read email instead of yet another website to read rss feeds. It won't solve your "search for the address of rss feeds on the site" but it will give you an idea about rss parsing. rss2email - http://rss2email.infogami.com/

[Tutor] Building RSS reader with Python

2008-11-05 Thread btkuhn
Hi everyone, I'm new to programming and am building a very basic rss reader for my first major project with python and GUI. As it is, I have it set up so that if I input an exact rss feed address (ex http://news.google.com/?output=rss) I can retrieve stories. Id like to make it so that I can

Re: [Tutor] serial port, revisited, but closer

2008-11-05 Thread A.T.Hofkamp
shawn bright wrote: Hey all, I am back again with the serial port stuff, i have verified that all the baud rate and settings are ok, had my unit talk directly to a serial port reader and it is looking good, however, i still am not seeming to be able to read this. I had a question that might mak

[Tutor] serial port, revisited, but closer

2008-11-05 Thread shawn bright
Hey all, I am back again with the serial port stuff, i have verified that all the baud rate and settings are ok, had my unit talk directly to a serial port reader and it is looking good, however, i still am not seeming to be able to read this. I had a question that might make me a clue. if i do t