Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
Sorry. Here is the entire Error stack if this can help. Traceback (most recent call last): File "/Users/vincentbalmori/Desktop/Python/py3e_source/chapter09/blackjackbetting.py", line 240, in main() File "/Users/vincentbalmori/Desktop/Python/py3e_source/chapter09/blackjackbetting.py", lin

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
Here is the other one that occurs when I lose Traceback (most recent call last): File "/Users/vincentbalmori/Desktop/Python/py3e_source/chapter09/blackjackbetting.py", line 240, in main() File "/Users/vincentbalmori/Desktop/Python/py3e_source/chapter09/blackjackbetting.py", line 236, in

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Andre Engels
On Fri, Jul 1, 2011 at 9:29 AM, Vincent Balmori wrote: > > Here is the other one that occurs when I lose > > Traceback (most recent call last): > File > > "/Users/vincentbalmori/Desktop/Python/py3e_source/chapter09/blackjackbetting.py", > line 240, in >main() > File > > "/Users/vincentbalmo

[Tutor] Limit raw_input to hundredth decimal point

2011-07-01 Thread Ryan Kirk
Is there a way to limit raw_input to the hundredth decimal point? For example, I'd like to allow the user to enter 5.75 but not 5.756: dollars = raw_input("Please enter a dollar amount: $") Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe

[Tutor] problem reading script

2011-07-01 Thread Lisi
I am supposed to be looking at scripts on-line, reading them and making sure that I understand them. I think taht most of teh things I can't make more than a guess at, are modules taht I don't know, and I can mostly make them out. But the unpaired double quotation mark, " , in the following ha

Re: [Tutor] problem reading script

2011-07-01 Thread Lisi
On Friday 01 July 2011 10:15:08 Lisi wrote: > I am supposed to be looking at scripts on-line, reading them and making > sure that I understand them. I think taht most of teh things I can't make > more than a guess at, are modules taht I don't know, and I can mostly make > them out. But the unpair

Re: [Tutor] problem reading script

2011-07-01 Thread Martin A. Brown
Greetings Lisi, : I am supposed to be looking at scripts on-line, reading them and : making sure that I understand them. When you see an example that you don't understand, consider trying to do something similar in an interactive Python interpreter. This is a simple way to learn in Python

Re: [Tutor] Limit raw_input to hundredth decimal point

2011-07-01 Thread Izz ad-Din Ruhulessin
You can use a regular expression or plain simple len() 2011/7/1 Ryan Kirk > Is there a way to limit raw_input to the hundredth decimal point? > > For example, I'd like to allow the user to enter 5.75 but not 5.756: > > dollars = raw_input("Please enter a dollar amount: $") > > Thanks! >

Re: [Tutor] Limit raw_input to hundredth decimal point

2011-07-01 Thread Christian Witts
On 2011/07/01 09:30 AM, Ryan Kirk wrote: Is there a way to limit raw_input to the hundredth decimal point? For example, I'd like to allow the user to enter 5.75 but not 5.756: dollars = raw_input("Please enter a dollar amount: $") Thanks! ___ Tutor m

Re: [Tutor] 2to3 conversion

2011-07-01 Thread Steven D'Aprano
Zubin Mithra wrote: Hey everyone, I was running 2to3 on a particular file and I got the following traceback( http://paste.pocoo.org/show/223468/). For short amounts of text, such as a traceback, please don't use a paste bin, just copy it into your post. Some people are reading mail at a tim

Re: [Tutor] 2to3 conversion

2011-07-01 Thread Steven D'Aprano
Steven D'Aprano wrote: Zubin Mithra wrote: Hey everyone, I was running 2to3 on a particular file and I got the following traceback( http://paste.pocoo.org/show/223468/). For short amounts of text, such as a traceback, please don't use a paste bin, just copy it into your post. *blinks*

Re: [Tutor] Limit raw_input to hundredth decimal point

2011-07-01 Thread Steven D'Aprano
Ryan Kirk wrote: Is there a way to limit raw_input to the hundredth decimal point? No. raw_input is a tool that does one thing: it collects input from the user. It doesn't understand numbers, check for decimal places, check the input for spelling errors, or anything else. It's a hammer, not a

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Emile van Sebille
On 7/1/2011 12:51 AM Andre Engels said... In this case, the error message says: NameError: global name 'bet' is not defined Note use of the term global? That means, at some time at the program, it is told to do something with 'bet', but there is no variable bet. And when does that happen?

Re: [Tutor] problem reading script

2011-07-01 Thread Steven D'Aprano
Lisi wrote: I am supposed to be looking at scripts on-line, reading them and making sure that I understand them. I think taht most of teh things I can't make more than a guess at, are modules taht I don't know, and I can mostly make them out. But the unpaired double quotation mark, " , in the

Re: [Tutor] problem reading script

2011-07-01 Thread Lisi
On Friday 01 July 2011 14:26:07 Steven D'Aprano wrote: > If they look the same to you, then you need to increase your font size, > change to a programmers font, or possible clean your glasses :) Thanks for the reply, Steven. Suggestions for "a programmers font" gratefully received. I do have p

Re: [Tutor] The Card Game

2011-07-01 Thread Christopher King
Sorry, I haven't upgraded to 3 yet. On Thursday, June 30, 2011, Steven D'Aprano wrote: > Christopher King wrote: > > I would go with __cmp__ which covers them all. 1 for greater, 0 for equal, > -1 for less than. > > > > So-called "rich comparisons" using __lt__, __gt__, etc. have been preferred

Re: [Tutor] 2to3 conversion

2011-07-01 Thread Lisi
On Friday 01 July 2011 14:05:22 Steven D'Aprano wrote: > Oh my, that's hilarious. > > Sorry folks, nothing to see here... I accidentally clicked on an unread > email from 2010 (!!!) and thought it had just come in. I'm glad that my eyes hadn't mislead me that much!! I was trying to find the orig

Re: [Tutor] The Card Game

2011-07-01 Thread Steven D'Aprano
Christopher King wrote: Sorry, I haven't upgraded to 3 yet. No need to apologise for that! Python 2.7 will be around a long time yet. -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.pytho

Re: [Tutor] problem reading script

2011-07-01 Thread Steven D'Aprano
Lisi wrote: On Friday 01 July 2011 14:26:07 Steven D'Aprano wrote: If they look the same to you, then you need to increase your font size, change to a programmers font, or possible clean your glasses :) Thanks for the reply, Steven. Suggestions for "a programmers font" gratefully received.

Re: [Tutor] problem reading script

2011-07-01 Thread Alan Gauld
"Lisi" wrote Suggestions for "a programmers font" gratefully received. I generally use Courier. Its ugly and old fashioned but it clearly shows the differences between i,l, | and 1 and '' and " and between ' and ` etc. and spaces are big enough to "see" clearly. :-) But I could copy a

Re: [Tutor] problem reading script

2011-07-01 Thread Corey Richardson
Excerpts from Alan Gauld's message of Fri Jul 01 13:03:40 -0400 2011: > > "Lisi" wrote > > > Suggestions for "a programmers font" gratefully received. > > I generally use Courier. > > Its ugly and old fashioned but it clearly shows > the differences between i,l, | and 1 and '' and " > and

Re: [Tutor] problem reading script

2011-07-01 Thread Steve Willoughby
On 01-Jul-11 10:56, Corey Richardson wrote: Excerpts from Alan Gauld's message of Fri Jul 01 13:03:40 -0400 2011: I use and love inconsolata[0], it's a great font for programming, and looks great as well (both on screen and off). I like inconsolata and Envy Code R, although just to be weird I t

[Tutor] Thank you. Was: Re: problem reading script

2011-07-01 Thread Lisi
Thank you all for such a lot of very helpful replies. I have been looking through the recommended fonts and am pleasantly surprised by how clear, legible and well differentiated some of them are. I have been using Bitstream Vera Sans Mono in KWrite, which gives me all the colours and spacing a

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
I was able to get the program started without errors now. What is left now is to: Having the stash change after winning and losing. No matter what, the value in stash stays the same. The conditional statement I made which prevents players with no money from playing is dependent on this. After e

Re: [Tutor] Blackjack Betting

2011-07-01 Thread Vincent Balmori
Also I must be doing something wrong if I have to enter a "bet = Bet()" into each function where it is used. I tried putting Bet into the other classes' arguments but it did not have any effect. Emile van Sebille wrote: > > On 7/1/2011 12:51 AM Andre Engels said... > >> In this case, the error

[Tutor] (no subject)

2011-07-01 Thread David Merrick
# Blackjack # From 1 to 7 players compete against a dealer import cards, games class BJ_Card(cards.Card): """ A Blackjack Card. """ ACE_VALUE = 1 @property def value(self): if self.is_face_up: v = BJ_Card.RANKS.index(self.rank) + 1 if v > 10: