Re: [Tutor] [Tutor} Why doesn't it choose a new number each time?

2007-02-15 Thread Nathan Pinno
Hey all, I edited my code, and it seems to choose a new number each time. Maybe I didn't run my test long enough the first time? I should have spotted the problem of choice(range(3)) a mile away. I edited that bit, and now I think it's running right. (25 rounds of Rock, Paper, Scissors s

[Tutor] Why doesn't it choose a new number each time?

2007-02-13 Thread Nathan Pinno
Hey all, I wrote a rock, paper, scissors game and every time you play without exiting, it chooses the same number. How can I fix this problem? The relative code is below: [code] # -*- coding: cp1252 -*-from random import * print "Welcome to Rock, Paper, or Scissors!"print "

Re: [Tutor] What's the invalid syntax?

2006-08-24 Thread Nathan Pinno
I sure did. It was choking because it was the wrong format. - Original Message - From: "Bob Gailer" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: "Tutor mailing list" Sent: Thursday, August 24, 2006 12:56 PM Subject: Re: [Tutor]

[Tutor] How do I make Python read a string character by character?

2006-08-23 Thread Nathan Pinno
Hey all,   How do I make Python read a string character by character?   Thanks, Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What's the invalid syntax?

2006-08-23 Thread Nathan Pinno
Sorry, but it only showed a text-box with the message "Invalid syntax!", then highlighted the %. HTH, Nathan Pinno - Original Message - From: "Alan Gauld" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor mailing list"

[Tutor] What's the invalid syntax?

2006-08-23 Thread Nathan Pinno
k = k + 1    elif X < E & Y < N:    print "Go NorthEast"    k = k + 1    else:    print "Congrats! You found the hurkle in", %d1.0, " guesses!" (k)    break    else:

Re: [Tutor] What's the invalid syntax?

2006-07-24 Thread Nathan Pinno
Ignore this. I've created too many errors to even begin to solve. - Original Message - From: Nathan Pinno To: Tutor mailing list Sent: Monday, July 24, 2006 7:24 PM Subject: What's the invalid syntax? What's the invalid syntax?   [code]

[Tutor] What's the invalid syntax?

2006-07-24 Thread Nathan Pinno
_input("Enter the 2nd year: "))    m2 = int(raw_input("Enter the 2nd month: "))    d2 = int(raw_input("Enter the 2nd day: "))    date2 = date(y2, m2, d2)    return date2   print "Date Calculator"print "By Nathan Pinno"printwhile 1:    menu()    menu_

[Tutor] Is there a method like this already?

2006-07-24 Thread Nathan Pinno
second date: "))   def calculate_days(year, month, day):    [/code]   Just being curious, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Nathan Pinno
Would it be this line? pickle.dump(ac, store) Would this make it work? ac = pickle.dump(store) Nathan - Original Message - From: "Bob Gailer" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Monday, June 26, 2006 5:33 PM Subject:

Re: [Tutor] Why doesn't it save the data before exiting? CORRECTION

2006-06-26 Thread Nathan Pinno
How do I know? Simple. Next time I load it and ask it to print the list of accounts and how much in each, I only get: Account Info then the menu again, with no info. Nathan Pinno - Original Message - From: "Bob Gailer" <[EMAIL PROTECTED]> To: "Bob Gailer&qu

[Tutor] Why doesn't it save the data before exiting?

2006-06-26 Thread Nathan Pinno
    else:    print account," was not found."   def withdraw():    print "Withdraw Funds."    account = raw_input("Account: ")    if accountlist.has_key(account):    amount = float(raw_input("Amount: "))    accountlist[account] -= amount   

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Nathan Pinno
lename): store = open(filename, 'r') for line in store: account = line.strip() amount = line.next().strip() ac[account] = amount else: store = open(filename, 'w') store.close Thanks. Nathan Pinno - Original

Re: [Tutor] Is this correct syntax for what I want?

2006-06-25 Thread Nathan Pinno
Thanks, it works now perfectly! Thanks for all the help! - Original Message - From: "Alan Gauld" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Sunday, June 25, 2006 1:07 AM Subject: Re: [Tutor] Is this correct syntax for what I want?

Re: [Tutor] Is this correct syntax for what I want?

2006-06-24 Thread Nathan Pinno
print account,"\t $",accountlist[account]+"\n" TypeError: unsupported operand type(s) for +: 'float' and 'str' So how do I fix this error? Thanks for the help so far! - Original Message ----- From: "Alan Gauld" <[EMAIL PROTECTED]> To

Re: [Tutor] Is this correct syntax for what I want?

2006-06-23 Thread Nathan Pinno
The data is account name and 12.50 (example). I want to access the data to add and subtract from it. For example 12.50 - 2.25 = 10.25 10.25 + 4.75 = 15.00 Thanks, Nathan Pinno - Original Message - From: "Alan Gauld" <[EMAIL PROTECTED]> To: "Nathan Pinno"

[Tutor] Needing help with my account tracker program.

2006-06-23 Thread Nathan Pinno
;Amount: "))    accountlist[account] += amount    print account,"\t $",accountlist[account]    else:    print account," was not found."   def withdraw():    print "Withdraw Funds."    account = raw_input("Account: ")    if accountli

[Tutor] Is this correct syntax for what I want?

2006-06-22 Thread Nathan Pinno
I want to be able to add and subtract from a number in a tuple in a list. Is this the correct syntax?   letterlist[x] = letterlist[x] + amount # for addition   letterlist[x] = letterlist[x] - amount # for subtraction   If this is not correct, what is the correct syntax?   Thanks, Nathan

[Tutor] How do I create the equivalent of a Java class in Python?

2006-05-13 Thread Nathan Pinno
Hey all,   How do I create the equivalent of a Java class in Python? I've been looking at the reference, and it's been confusing to me at least.   Thanks, Nathan Pinno   ___ Tutor maillist - Tutor@python.org http://mail.python.o

[Tutor] How do I do cubic roots and cubic exponents (and higher roots and exponents) in Python?

2006-05-08 Thread Nathan Pinno
Hi all,   How do I do cubic (and higher) roots and exponents in Python? I already took a look in Python and didn't find anything.   Thanks, Nathan Pinno Web Surfer's Store http://www.websurfstore.ca MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 ICQ:

[Tutor] What's the invalid syntax?

2006-04-05 Thread Nathan Pinno
Hey all,   What's the invalid syntax in the following code? I tried figuring it out by myself, and I couldn't.   # This program finds the date of Easter Sunday between the years 1900 & 2099.# By Nathan Pinno# Inspired by Programming and Problem Solving with Java, 1st ed., qu

Re: [Tutor] How do I fix this IndexError?

2005-12-20 Thread Nathan Pinno
Thanks Simon! It worked like a charm! All I have to do now is change it into GUI format, and then use py2exe to create an executable file. Thanks for all the help! Nathan Pinno MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705 -Original

Re: [Tutor] How do I fix this IndexError?

2005-12-20 Thread Nathan Pinno
Simon and all, What would you recommend? I don't know what I should code, because I haven't coded anything that loads a file. Thanks, Nathan Pinno MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705 -Original Message- From: Si

[Tutor] How do I fix this IndexError?

2005-12-20 Thread Nathan Pinno
Here is the error: The Currency Exchange ProgramBy Nathan Pinno   Traceback (most recent call last):  File "D:\Python24\exchange.py", line 28, in -toplevel-    exch = pickle.load(store)  File "D:\Python24\lib\pickle.py", line 1390, in load    return Unpickler(f

[Tutor] How do I fix this Invalid Mode?

2005-12-17 Thread Nathan Pinno
Here is the latest error: The Currency Exchange ProgramBy Nathan Pinno   Traceback (most recent call last):  File "D:\Python24\exchange.py", line 27, in -toplevel-    store = open('exch.txt', 'b')#loadIOError: invalid mode: b   and the latest code:

Re: [Tutor] How do I fix this IndexError?

2005-12-16 Thread Nathan Pinno
Danny, 'conv' is for the name of the conversion [i.e 'can_us'] and rate is for the conversion rate [i.e. 0.80276] Thanks, Nathan Pinno, MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705 -Original Message- From: Dann

[Tutor] How do I fix this IndexError?

2005-12-16 Thread Nathan Pinno
ickle.dump(conv,rate) store.close() def load_rates(exch): store = open('exch.txt','r') exch = pickle.load(store) store.close() And here is the latest error: The Currency Exchange Program By Nathan Pinno Traceback (most recent call last): File "D:\Py

[Tutor] How do I fix this StopIteration error?

2005-12-15 Thread Nathan Pinno
7;) # create new empty file    store.close()   When I ran the program, I got this: The Currency Exchange ProgramBy Nathan Pinno   Traceback (most recent call last):  File "D:\Python24\exchange.py", line 45, in -toplevel-    load_rates(rates)  File "D:\Python24\exchange.py",

[Tutor] How do I fix this error so that my exchange rates program will work?

2005-12-14 Thread Nathan Pinno
currency."    print "5. Update exchange rates."    print "9. Save and Exit"   def exchange_update():    print "1. Update Canadian to US rate."    print "2. Update US to Canadian rate."    print "3. Update Canadian to Euro rate."    print

[Tutor] Is this a good idea to improve my currency program?

2005-12-14 Thread Nathan Pinno
?   Thanks Nathan Pinno, MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705   ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Does anyone have any experience with ezPyCrypto?

2005-12-02 Thread Nathan Pinno
Does anyone have any experience with ezPyCrypto? If so, can you please tell me whether or not I can use it to encrypt dictionaries (i.e. user:password or site:username password for examples)?   Thanks, Nathan Pinno, Co-owner/co-operator of The Web Surfer's Store. http://www.the-web-su

Re: [Tutor] Is it a good idea to use TKInter to change my password program into a GUI?

2005-12-02 Thread Nathan Pinno
I like the Toolkit, is there anywhere where there is a how to use it?   Thanks, Nathan Pinno, Co-owner/co-operator of The Web Surfer's Store. http://www.the-web-surfers-store.com/ MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705     From:

[Tutor] How does pickle save files?

2005-11-30 Thread Nathan Pinno
Hey all,   In what format does pickle save files as? I mean it is .txt, .dat, or some other way?   Thanks Nathan Pinno, Owner/operator of The Web Surfer's Store. http://www.the-web-surfers-store.com/ MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 1990

Re: [Tutor] Is it a good idea to use TKInter to change my password program into a GUI?

2005-11-29 Thread Nathan Pinno
Hey Danny and all, Alberto told me that there was a password entry box in TKInter. Can anyone tell me about that, please? Thanks, Nathan Pinno, Owner/operator of The Web Surfer's Store. http://www.the-web-surfers-store.com/ MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter3

[Tutor] Is it a good idea to use TKInter to change my password program into a GUI?

2005-11-27 Thread Nathan Pinno
site = raw_input("Site: ") if sitelist.has_key(site): del sitelist[site] else: print site," was not found."   def print_login_info():    print "Login Info"    for site in sitelist.keys():    print "Site: ",site," \tID Pass

Re: [Tutor] Do I have to initialize TKInter before I can use it?

2005-11-15 Thread Nathan Pinno
Albertito and all, It worked! Thanks again! Thanks for all the help! Nathan Pinno, Owner/operator of The Web Surfer's Store. http://www.the-web-surfers-store.com/ MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705 -Original Message-

Re: [Tutor] Do I have to initialize TKInter before I can use it?

2005-11-14 Thread Nathan Pinno
_ BaseWidget._setup(self, master, cnf) File "D:\Python24\lib\lib-tk\Tkinter.py", line 1840, in _setup self.tk = master.tk AttributeError: 'str' object has no attribute 'tk' What does this mean, and how can I get it working? Nathan -Original Message- F

Re: [Tutor] How do I display a changing thing in text?

2005-11-14 Thread Nathan Pinno
Hugo and all, So in order to write what I wanted the correct code would be: "Computer = %1.0d Player = %1.0d" (a,b) Am I correct or is this wrong? Nathan Pinno -Original Message- From: Hugo González Monteverde [mailto:[EMAIL PROTECTED] Sent: November 14, 2005 8:27 PM To: Na

Re: [Tutor] Do I have to initialize TKInter before I can use it?

2005-11-14 Thread Nathan Pinno
Tutor] Do I have to initialize TKInter before I can use it? To: Tutor Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1 On 15/11/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: > > > John and all, > > I am having problems. The latest erro

[Tutor] How do I display a changing thing in text?

2005-11-14 Thread Nathan Pinno
How do I display a changing thing (i.e.. the score of the game) in text? I think it has something to do with this key: %, but I forget how to do it. Can someone show me how to do it again?   Thanks, Nathan Pinno ___ Tutor maillist - Tutor

Re: [Tutor] Do I have to initialize TKInter before I can use it?

2005-11-14 Thread Nathan Pinno
e to do in this case?   Nathan Pinno Date: Tue, 15 Nov 2005 12:41:57 +1300From: John Fouhy <[EMAIL PROTECTED]>Subject: Re: [Tutor] Do I have to initialize TKInter before I can useit?To: Tutor <tutor@python.org>Message-ID: <[EMAIL PROTECTED]>Content-Type: text/plain; cha

[Tutor] Do I have to initialize TKInter before I can use it?

2005-11-14 Thread Nathan Pinno
Hey all,   Do I have to initialize TKInter before I can use it, and if so, how would I go about doing that?   Thanks, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Can I use TKInter and Pygame together?

2005-11-12 Thread Nathan Pinno
Hey all,   Can I use Pygame and TKInter together in the same application? I want to use TKInter for the message boxes, and Pygame for the actual game interface, but is this possible?   Nathan Pinno ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] How do I make a text box pop up in a GUI before the mainpart of the program loads?

2005-11-12 Thread Nathan Pinno
Actually, I'm going to be using Pygame. I need to know, because I want to pop up a polite explanation of how to play the game and a reminder. Nathan Pinno - Original Message - From: Alan Gauld To: Nathan Pinno ; tutor@python.org Sent: November 12, 2005 10:47 AM Su

[Tutor] How do I make a text box pop up in a GUI before the main part of the program loads?

2005-11-12 Thread Nathan Pinno
Hey all,   How do I make a text box pop up in a GUI before the main part of the program loads?   Thanks, Nathan Pinno, Owner/operator of The Web Surfer's Store. http://www.the-web-surfers-store.com/   BEGIN:VCARD VERSION:2.1 N:Pinno;Nathan;Paul;Mr. FN:Pinno, Nathan Paul ORG:Z

[Tutor] Does Pygame allow background images?

2005-11-07 Thread Nathan Pinno
Hey all,   Does Pygame allow background images (i.e. a hockey rink for a hockey game)?   Thanks, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How I use images in a GUI?

2005-11-06 Thread Nathan Pinno
Title: Message Liam, I am using Pygame, but I am still don't know how to use it. I read it, and it confused me. - Original Message - From: Liam Clarke-Hutchinson To: 'Nathan Pinno' Cc: 'tutor@python.org' Sent: November 6, 2005 3:47 PM Subje

[Tutor] How I use images in a GUI?

2005-11-06 Thread Nathan Pinno
Hey all,   I have a question that I can't figure out, despite reading the help and everything else. How do I use an image or images in a Graphic User Interface, and link them to parts of my code i.e. a picture of a game piece to its value?   Thanks in advance, Nathan

[Tutor] Albertito and I want you to help us create a search engine.

2005-10-28 Thread Nathan Pinno
Hey all,   Albertito and I want you all to help us create a search engine for our site. Albertito heard that Google was created in Python, is this true? I want to know if such a task is possible, and if so, who is willing to help us create the script needed for our site. Thanks, Nathan Pinno Crew

Re: [Tutor] Can anyone help me?

2005-10-28 Thread Nathan Pinno
range(1,50)) numbers.append(draw) print numbers numbers = [] elif q == 2: break else: print "Read the instructions please." [/code] Enjoy! Nathan Pinno For great sites go to: http://falcon3166.tripod.com MSN Messenger: [EMAIL PROTECTED],com Yahoo! Messenger

Re: [Tutor] ***[Possible UCE]*** Can anyone help me?

2005-10-28 Thread Nathan Pinno
Thanks Martin. You have a solid point. It would be a fun programming exercise anyway...I haven't programmed in ages it seems. :) Nathan Pinno For great sites go to: http://falcon3166.tripod.comMSN Messenger: [EMAIL PROTECTED],comYahoo! Messenger: spam_swatter31ICQ: 199020705AIM: f3m

Re: [Tutor] Can anyone help me?

2005-10-27 Thread Nathan Pinno
yself. Nathan Pinno Crew, McDonalds Restaurant and fan extraordinare of the Oilers. http://falcon3166.tripod.com From: bob <[EMAIL PROTECTED]>To: "Nathan Pinno" <[EMAIL PROTECTED]>, Subject: Re: [Tutor] Can anyone help me?Date: Thu, 27 Oct 2005 21:35:07 -0700>At 07:07 PM

[Tutor] Can anyone help me?

2005-10-27 Thread Nathan Pinno
Hey all, I am trying to create a program that draws 6 numbers between 1 and 49 at random for creating lottery tickets. I want to have a better chance when I play. Can anyone help me code this or show me how to, please? Thanks, Nathan Pinno For great sites go to: http://falcon3166

[Tutor] Can anyone teach me...?

2005-10-12 Thread Nathan Pinno
Hey all, When I said that I might go to Visual Basic in an earlier message, someone replied by saying that I should ask here how to do it in Python. Well, I'm asking now: Can anyone teach me how to make a simple program that uses a GUI? Thanks, Nathan Pinno Crew, McDonalds Restaurant an

Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-30 Thread Nathan Pinno
Lisa and all,   I got rid of that portion of my site. All that's there now is the e-book publishing part of my site.   Nathan Pinno - Original Message - From: Lisa Fukui To: Nathan Pinno Sent: Friday, September 30, 2005 11:22 AM Subject: Re: [Tutor] Challenge [w

Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-26 Thread Nathan Pinno
The actual URL is http://zoffee.tripod.com/purchasecompprogs.htm - Original Message - From: bob To: Nathan Pinno Cc: tutor@python.org Sent: Monday, September 26, 2005 11:54 AM Subject: Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?] At

Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-26 Thread Nathan Pinno
Bob,   I did what you suggested. Take another look, and tell me if you were a potential customer, would you purchase something?   Why not take the challenge? It's not like I'm asking much.   Nathan Pinno - Original Message - From: bob To: Nathan Pinno

[Tutor] Help with pi and the math module.

2005-09-23 Thread Nathan Pinno
Hi all,   I need help with pi and the math module. I had import math at the top of a program, but when it came to diameter*pi, it said that pi was not defined.   How do I use it correctly?   Thanks, Nathan Pinno ___ Tutor maillist - Tutor

Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-22 Thread Nathan Pinno
The URL is http://zoffee.tripod.com/purchasecomprogs.htm, and here is a third alternative: If the group says it is okay, I'll add them to the By: line as The Python Group, and I'll donate half of the sales to a charity of the group's choice.   Nathan Pinno - O

Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-22 Thread Nathan Pinno
  http://zoffee.tripod.com/purchasecompprogs.htm is the URL. - Original Message - From: Adam To: Nathan Pinno Sent: Thursday, September 22, 2005 5:21 AM Subject: Re: [Tutor] Challenge [was Re: Why won't it enter the quiz?] What's the URL? O

[Tutor] Challenge [was Re: Why won't it enter the quiz?]

2005-09-21 Thread Nathan Pinno
of it myself. Fair enough? Farewell for now, Nathan Pinno. - Original Message - From: "Byron" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Friday, September 16, 2005 9:25 PM Subject: Re: [Tutor] Why won't it enter the quiz? > Nath

Re: [Tutor] Why won't it enter the quiz?

2005-09-17 Thread Nathan Pinno
I can see that I was wrong. I was tired, and I don't always think too smart. It should be cq <= q. :) Nathan Pinno - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Saturday, September 1

[Tutor] Thank you all! was (Re: How do fix this error?)

2005-09-17 Thread Nathan Pinno
Hey all,   I would like to thank everyone here and at Programmer's Heaven for all their help. Thanks again!   Gratefully, Nathan Pinno - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; <tutor@python

[Tutor] How do fix this error?

2005-09-16 Thread Nathan Pinno
right: ",(correct/q)*100print "Goodbye." How do I fix it so that it runs without anymore errors or problems?   Thanks for the help so far, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why won't it enter the quiz? (off topic)

2005-09-16 Thread Nathan Pinno
cq += 1 elif guess == answer: print "Correct!" correct += 1 cq += 1 else: print "Questions: ",q print "Correct: ",correct print "Percent Correct: ",(cq/q)*100 break print "

Re: [Tutor] Why won't it enter the quiz?

2005-09-16 Thread Nathan Pinno
Thanks to hear that. I will keep posting, though no sales, so not a great business model. Any help with the original question? Thanks, Nathan Pinno - Original Message - From: "Byron" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Fr

Re: [Tutor] Why won't it enter the quiz?

2005-09-16 Thread Nathan Pinno
at me. Oh well, guess I can't get help as a newbie... I guess I should have erased my signature from these messages sooner rather than later, to prevent this e-mail. Regards, Nathan Pinno > Date: Fri, 16 Sep 2005 19:03:10 -0700 > From: Byron <[EMAIL PROTECTED]> > Subject: Re: [

Re: [Tutor] Why won't it enter the quiz?

2005-09-16 Thread Nathan Pinno
cq is for "current question" and q is for "question" therefore cq >= q should be correct most of the time - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Friday, September 1

Re: [Tutor] Will the following code ever exit?

2005-09-16 Thread Nathan Pinno
Thanks, but when I run the code, even after that change it always just prints the questions, correct questions(which is always 0), and percent right(always 0). How do I make it enter the quiz. Thanks, Nathan Pinno - Original Message - From: "John Fouhy" <[EMAIL PROTECTED]

[Tutor] Why won't it enter the quiz?

2005-09-16 Thread Nathan Pinno
oodbye."   It just prints out for an example:   Questions:  17Correct:  0Percent Correct:  0Goodbye.   Thanks, Nathan Pinno BEGIN:VCARD VERSION:2.1 N:Pinno;Nathan;Paul;Mr. FN:Pinno, Nathan Paul NICKNAME:Spam_swatter ORG:Woffee;Executive TITLE:Owner/operator TEL;WORK;VOICE:7806085529 TEL;CELL;VOICE:

[Tutor] Will the following code ever exit?

2005-09-16 Thread Nathan Pinno
Correct!"   correct += 1   cq += 1else:   print "Questions: ",q   print "Correct: ",correct   print "Percent Correct: ",(correct/q)*100   Thanks, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Do I have to include certain items in the setup.py file?

2005-09-16 Thread Nathan Pinno
It sure does! Thanks. For great sites go to: http://falcon3166.tripod.com For great products go to: http://zoffee.tripod.com - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: "Tutor mailing list"

Re: [Tutor] Do I have to include certain items in the setup.py file?

2005-09-16 Thread Nathan Pinno
It sure does. Thanks Danny. One final question: Is it possible to write one setup.py and use it for multiple Python programs? Thanks, Nathan Pinno For great sites go to: http://falcon3166.tripod.com For great products go to: http://zoffee.tripod.com - Original Message - From: "Dann

[Tutor] Do I have to include certain items in the setup.py file?

2005-09-16 Thread Nathan Pinno
Hey all,   I was curious about what I have to include in the setup.py file. Do I have to include such statements as "import random" if the code uses import random and the random functions in its code for example?   Hopefully this is not a beginner's question, Nathan Pinno For

[Tutor] How to save updated values in a program?

2005-09-01 Thread Nathan Pinno
Hey all,   How do I save updated values in a program when it quits? Are the new values automatically saved, or do I have to code it in to the program in order to save the updated values?   I need to know because I have a currency exchange program that is updated manually by the user, and I wa

Re: [Tutor] Is there anyway to set how many numbers are used after the decimal in floating numbers?

2005-08-18 Thread Nathan Pinno
I want to use it for a currency exchange program. It's useful, then the user wouldn't have to round it himself/herself, and mistakes could be avoided. Nathan Pinno --- Early to bed, Early to rise, Makes a man healthy, wealthy

[Tutor] Is there anyway to set how many numbers are used after the decimal in floating numbers?

2005-08-18 Thread Nathan Pinno
Hi all,   Is there anyway to set how many numbers are used after the decimal in floating numbers? It would be nice if the answer could be rounded to 2 decimal spots, instead of the ten millionths spot.   Thanks in advance, Nathan Pinno

Re: [Tutor] How can I make this run right?

2005-08-15 Thread Nathan Pinno
--- - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor mailing list" Sent: Monday, August 15, 2005 2:20 AM Subject: Re: [Tutor] How can I make this run right? >> The following code i

[Tutor] How can I make this run right?

2005-08-14 Thread Nathan Pinno
The following code is supposed to take in a number, and print number!: n = int(raw_input("Number: "))x = n-1while 1:    t = n*x    while x > 1:    x -= 1    else:    breakprint t Why isn't it working, and how can I make it print out the correct output?   Thanks in advance, Nathan --

[Tutor] Is it possible to...

2005-08-14 Thread Nathan Pinno
Is it possible to create a def that not only deals cards, but also assigns a value to each rank, except that the Jacks, Queens, and Kings all are the same value as the 10s?   If this is possible, how should I go about doing this?   Sorry if I'm asking what for most people is a basic question,

[Tutor] Question on listing cards, then deleting one or more items by user's choice.

2005-08-09 Thread Nathan Pinno
Say I deal 5 cards, and then list them. How would I print the list of cards, with the numbers of each card(the position in the list)? Then delete a certain card or cards, based upon the user's choice?.   Nathan ---Early to bed,Early

Re: [Tutor] How to I make it save the data properly? (was Re: How do Ifix this ValueError?)

2005-08-09 Thread Nathan Pinno
I fixed it. The problem was this line: ID = line.strip().strip() I fixed it so that it now reads: ID = store.next().strip() As a result, the program runs perfectly. Nathan Pinno --- Early to bed, Early to rise, Makes a man healthy

[Tutor] How to I make it save the data properly? (was Re: How do I fix this ValueError?)

2005-08-09 Thread Nathan Pinno
site = raw_input("Site: ") if sitelist.has_key(site): del sitelist[site] else: print site," was not found." def print_login_info(): print "Login Info" for site in sitelist.keys(): print "Site: ",site,"

Re: [Tutor] How do I fix this ValueError?

2005-08-09 Thread Nathan Pinno
nklin --- - Original Message - From: <[EMAIL PROTECTED]> To: "Tutor mailing list" Sent: Tuesday, August 09, 2005 7:13 PM Subject: Re: [Tutor] How do I fix this ValueError? > Quoting Nathan Pinno <[EMAIL PR

[Tutor] How do I fix this ValueError?

2005-08-09 Thread Nathan Pinno
ite]     else: print site," was not found."   def print_login_info():    print "Login Info"    for site in sitelist.keys():    print "Site: ",site," \tID: ",sitelist[site][0]," \tPassword: ",sitelist[site][1],"\n"   print &q

[Tutor] What can I do with this code?

2005-08-09 Thread Nathan Pinno
I coded the following just for fun:   import randomcool = ['Cool math!','Awesome!','Way to go!','Happy problem solving!']while 1:    start = raw_input("Do you want to do some math? Yes or No")    if start == "Yes":    x = int(raw_input("First number:"))    y = int(raw_input("Second

Re: [Tutor] Use functions re avoid Re: Can the following algorithmbe improved?

2005-08-09 Thread Nathan Pinno
Brian van den Broek" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: "Tutor mailing list" Sent: Tuesday, August 09, 2005 3:23 PM Subject: Re: [Tutor] Use functions re avoid Re: Can the following algorithmbe improved? > Nathan Pinno said unt

Re: [Tutor] deck dealing program

2005-08-09 Thread Nathan Pinno
Thanks Luke. You've helped me out of a jam that I was going to ask without even asking.   Nathan ---Early to bed,Early to rise,Makes a man healthy, wealthy, and wise.--Benjamin Franklin

[Tutor] (OT) Info on card games.

2005-08-09 Thread Nathan Pinno
Hey all,   I marked it off-topic, but it is necessary to mail this to the mailing list. People asked questions when I first put up my blackjack game(the beginning code of it anyway), so here is a site that has the rules of card games, since I'll be writing them on Python.   It's http://www.pa

Re: [Tutor] Use functions re avoid Re: Can the following algorithmbe improved?

2005-08-09 Thread Nathan Pinno
--- - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Brian van den Broek" <[EMAIL PROTECTED]> Cc: "Tutor mailing list" Sent: Tuesday, August 09, 2005 1:32 PM Subject: Re: [Tutor] Us

Re: [Tutor] Use functions re avoid Re: Can the following algorithm be improved?

2005-08-09 Thread Nathan Pinno
jamin Franklin --- - Original Message - From: "Brian van den Broek" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: "Tutor mailing list" Sent: Sunday, August 07, 2005

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-07 Thread Nathan Pinno
After reading what Steve Reighard and Danny wrote, I've decided that I was wrong. I'm sorry. I'm almost done my new algorithm, and will share it with the group.   Nathan ---I wanted help, and you criticized me,I wanted aid, and you r

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-07 Thread Nathan Pinno
--- - Original Message - From: "R. Alan Monroe" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Sent: Sunday, August 07, 2005 3:04 PM Subject: Re: [Tutor] What's the invalid syntax? Code sup

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-07 Thread Nathan Pinno
to shreds by you, and dash my idea before it even takes off. I will keep my ideas to myself, Nathan Pinno --- I wanted help, and you critised me, I wanted aid, and you refused, So I will do it myself! --Auth

[Tutor] What's the invalid syntax? Code supplied

2005-08-05 Thread Nathan Pinno
types = {    '0' : ["Diamonds"]    '1' : ["Hearts"]    '2' : ["Spades"]    '3' : ["Clubs"]    }playercards = [a,b,c,d,e]t = [t1,t2,t3,t4,t5]def menu():    print "1. Deal a hand"    print "2. Exit&q

[Tutor] Is there a qucker method than the following?

2005-08-05 Thread Nathan Pinno
t;Jack","Queen","King"]hand = {numbers:cards}   def menu():    print "1. Deal a hand"    print "2. Exit"   def option():    return int(raw_input("Option: "))   def deal():    a,b,c,d,e = random.choice(13)   print "The Five Card Dealer&q

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-05 Thread Nathan Pinno
Hi all, It's Zoffee now, thanks to a Google search. Don't want to confuse customers. :) For your info, Zoffee is a company where I sell computer programs online which I write. Simple enough, eh? G2G, Nathan Pinno, Crew, Camrose McDonalds and owner/operator of Zoffee - Origin

Re: [Tutor] How do I fix the following error? Code and errormessage supplied.

2005-08-04 Thread Nathan Pinno
Thank you to all. The Password Program works perfectly. Time for me to relax and finish up my other loose project ends, and then I'll be able to start another major project. - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Danny Yoo"

Re: [Tutor] How do I fix the following error? Code and error message supplied.

2005-08-03 Thread Nathan Pinno
Hey Danny and all, Alan's tutorial did help me, and showed me how to correctly load a file upon entry, and save upon exit. It should be smooth sailing from here on it. Thank again, Nathan --- Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pin

Re: [Tutor] What's the invalid syntax? Code supplied

2005-08-03 Thread Nathan Pinno
xt to export: ") filename = raw_input("File to write to: ") out_file = open(filename,"w") out_file.write(text) out_file.close() - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Danny Yoo" <[EMAIL PROTECTED]> Cc: "Tu

  1   2   3   >