a way to keep track of # of clicks

2007-12-10 Thread Shawn Minisall
Is there a way to keep track of the number of times someone clicks on a menu item in a prorgam? What I want to do is make the rectangle disappear after they click on it at the main menu 3 times so visually show them they can't do it any longer. Since I appended the button to a main menu list,

Re: a way to keep track of # of clicks

2007-12-09 Thread Shawn Minisall
Is there a way to keep track of the number of times someone clicks on a menu item in a prorgam? What I want to do is make the rectangle disappear after they click on it at the main menu 3 times so visually show them they can't do it any longer. Since I appended the button to a main menu

highscores list

2007-12-08 Thread Shawn Minisall
I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes to read in the high scores from the file when I play again.

Highscores list

2007-12-08 Thread Shawn Minisall
I'm writing a game that uses two functions to check and see if a file called highScoresList.txt exists in the main dir of the game program. If it doesn, it creates one. That part is working fine. The problem is arising when it goes to read in the high scores from the file when I play again.

project - trivia game

2007-12-04 Thread Shawn Minisall
For my final project, I'm trying to do a GUI based game similar to are you smarter then a 5th grader. I've been working on it and am stuck with some code someone helped me with to randomize the A,B,C,D letters that the correct answer is assigned too. The code that does this is highlighted in

RE project - trivia game

2007-12-04 Thread Shawn Minisall
Sorry, 4got to send it in html for the bold parts. thx def drawMainMenu(win): #define and draw the buttons mainMenuList = [] mainMenuList.append (CreateRect(4,6,7,8,grey,win)) mainMenuList.append (CreateRect(3.5,6.5,5,6,grey,win)) mainMenuList.append

get mouse

2007-11-27 Thread Shawn Minisall
I'm just trying to test and see if the get mouse statements are working in my program. If they are, in the console window, it should go back to the prompt. It doesn't for all of them, just the last rectangle...sometimes. Am I setting them up correctly? here's the relevant code...thx The

a few questions.

2007-10-31 Thread Shawn Minisall
1. whats the best way to round a result to 4 decimal places? I tried round, but then read that it only works with exponents of 10. I'm trying to do it on this piece of code. time = (distance / 4900) 2. What direction would I go in if I'm getting 5 inputs from the user and want to make a bar

Re: clear shell screen

2007-10-29 Thread Shawn Minisall
Hmm...it works fine within the command line but then when I import os in python and then try os.system(cls), i get that very fast opening/closing window and 0 inside the shell. Gabriel Genellina wrote: En Mon, 29 Oct 2007 00:08:14 -0300, Shawn Minisall [EMAIL PROTECTED] escribi�: Does

Re: while within while

2007-10-28 Thread Shawn Minisall
or ever cover them in class. I think we get to true statements in the next chapter next week. It turns out that my problem was with indentation, as soon as I fixed it, it's working perfectly now. thx Dennis Lee Bieber wrote: On Sat, 27 Oct 2007 15:11:37 -0400, Shawn Minisall [EMAIL

clear shell screen

2007-10-28 Thread Shawn Minisall
Does anyone know how to clear the shell screen completely ? I tried import os and then os.system(clear) was said to have worked in Windows XP, but it's just bringing up another window, then it turns black and then it closes in within about a second moving the prompt at the os.system(clear)

while within while

2007-10-27 Thread Shawn Minisall
I've been having some problems with using a while statement for one menu within another while statement for the main menu, first time I've done it. It's with choice number two from the menu. When I run the program, I get a UnboundLocalError: local variable 'ai' referenced before assignment.

while within while

2007-10-27 Thread Shawn Minisall
K I've since fixed the UnboundLocalError: local variable 'ai' referenced before assignment error, I forgot to include decision = (1, 2, 3) inside for each number. Now when I run it, I get this.. main() READY TO PLAY ROCK, PAPER, SCISSORS??? Please choose from the following menu: 1. See

Re: for loop

2007-10-24 Thread Shawn Minisall
I agree, but if I want to get a A on the program, thats how my professor wants the output. :) [EMAIL PROTECTED] wrote: On Oct 22, 9:12?pm, Shawn Minisall [EMAIL PROTECTED] wrote: Thanks, everyone! Using everyone's suggestions and points, the program is working great now

greatest and least of these...

2007-10-23 Thread Shawn Minisall
I just wrote a program to let the user input a series of whole numbers and tell them which is least and which is greatest based off of a menu. However, the menu isn't kicking in after they pick a number. I included a while statement for a loop just for the menu and compared it to my other

for loop

2007-10-22 Thread Shawn Minisall
#Intro print * print WELCOME TO THE POPULATION GROWTH CALCULATOR print * print This program will predict the size of a population of organisms. print print

Re: for loop

2007-10-22 Thread Shawn Minisall
): population = population + ( population * increase ) print \t,p, [EMAIL PROTECTED] wrote: On Oct 22, 5:37 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Oct 22, 5:22 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Mon, 22 Oct 2007 18:17:56 -0400, Shawn Minisall

while statements

2007-10-16 Thread Shawn Minisall
I just learned about while statements and get why you place them around inputs for validation, but I'm a little lost on exactly where to place it with what condition in this program where the number of fat grams exceeds the total number of calories so that it loops back and asks you the two

if then elif

2007-10-10 Thread Shawn Minisall
I just learned about if, then elif statements and wrote this program. The problem is, it's displaying all of the possibilities even after you enter a 0, or if the fat grams are more then the total number of calories , that is supposed to stop the program instead of continuing on with the

ValueError: too many values to unpack,

2007-09-27 Thread Shawn Minisall
I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this ValueError: too many values to unpack I've googled it and it says that happens when you have too few or too many strings that don't

ValueError: too many values to unpack

2007-09-27 Thread Shawn Minisall
I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this ValueError: too many values to unpack I've googled it and it says that happens when you have too few or too many strings that don't

Re: ValueError: too many values to unpack,

2007-09-27 Thread Shawn Minisall
Marc 'BlackJack' Rintsch wrote: On Thu, 27 Sep 2007 12:36:58 -0400, Shawn Minisall wrote: With the multiple value lines, python says this ValueError: too many values to unpack I've googled it and it says that happens when you have too few or too many strings that don't match

Re: ValueError: too many values to unpack,

2007-09-27 Thread Shawn Minisall
Fredrik Lundh wrote: Shawn Minisall wrote: Sorry, it looks like it's on the fourth line with the 3 values on line 4...its reading line 3 fine Traceback (most recent call last): File pyshell#0, line 1, in module main() File I:\COMPUTER PROGRAMMING CLASS\PROJECT #1\project1.py

too many values with string.split

2007-09-22 Thread Shawn Minisall
I'm trying to unpack a list of 5 floats from a list read from a file and python is telling me 5 variables are too many for the string.split statement. Anyone have any other idea's? NOTE: the only reason I convert it to a float instead of just leaving it as a string in the loop is because I

acronym program

2007-09-21 Thread Shawn Minisall
I'm trying to write a program that gets the first letter of every word of a phrase and prints it on screen. I'm having problems with it. I'm thinking a for loop would be good since I don't know the exact number of words the user is going to enter, but after that I get confused. How do I

Re: acronym program

2007-09-21 Thread Shawn Minisall
work both ways? Paul Rudin wrote: Shawn Minisall [EMAIL PROTECTED] writes: I'm trying to write a program that gets the first letter of every word of a phrase and prints it on screen. I'm having problems with it. I'm thinking a for loop would be good since I don't know the exact number

qa

2007-09-17 Thread Shawn Minisall
I'm trying to get a space in between these two strings but it's ignoring the space in between when it prints. string.capwords (string.join([s1 + + s2])) * 3 'Spam Ni!Spam Ni!Spam Ni!' -- http://mail.python.org/mailman/listinfo/python-list

string questions

2007-09-15 Thread Shawn Minisall
Hi everyone, I'm a beginning programming student in Python and have a few questions regarding strings. If s1 = spam If s2 = ni! 1. Would string.ljust(string.upper(s2),4) * 3 start it at the left margin and move it 12 spaces to the right because of the 4 *3? If so, why is it in the

thanks everyone for your replies!

2007-09-15 Thread Shawn Minisall
:) -- http://mail.python.org/mailman/listinfo/python-list