[Tutor] How do I make Python calculate square roots?

2005-07-02 Thread Nathan Pinno
Hi all,Does anyone know how to make Python calculate square roots?   Thanks, Nathan Pinnohttp://www.npinnowebsite.ca/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to get 4 numbers from the user in one line for easy comparision?

2005-07-02 Thread Nathan Pinno
I saw that great idea from Steven, and I appreciate it. I think it will work. Just need to figure out how to get 4 numbers from the player on one line for easy comparison, e.g. telling whether the number is correct position and number, incorrect position and correct number, or both are incorr

[Tutor] Is there a way to combine a request for numbers and letters?

2005-07-04 Thread Nathan Pinno
Hi all,   Is there a way to combine a request for numbers and letters (e.g. user id and passwords)?   Thanks, Nathan Pinnohttp://www.npinnowebsite.ca/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is there a way to combine a request for numbers and letters?

2005-07-04 Thread Nathan Pinno
Sorry,   Just remembered that strings can include both letters and numbers. Case closed.   Nathan PinnoCrew, McDonalds Restaurant, Camrose, AB Canadahttp://www.npinnowebsite.ca/ - Original Message - From: Nathan Pinno To: tutor@python.org

[Tutor] What's wrong with this code?

2005-07-04 Thread Nathan Pinno
What's wrong with this code? I'm using 2.2.3 if this helps.   #This is for a password protected program to store passwords. password = "hello"print "The Password Program"print "Copywrite 2005. All Rights Reserved."printanswer = raw_input("What is the password? ")while password !=

Re: [Tutor] What's wrong with this code?

2005-07-06 Thread Nathan Pinno
t;,x," \tID: ",numbers[x]," \tPassword: ",numbers[x] print menu_choice = input("Choose an option: ") elif menu_choice == 5: filename = raw_input("Filename to save: ") save_login(list,filename) menu_choice = input("C

[Tutor] Why is this error showing up? (Original Message: (Tutor) What's wrong with this code?) Ignore previous post.

2005-07-06 Thread Nathan Pinno
ad a file?   Here's the latest code:   # This is the code for a password protected program to store passwords.password = "hello"print "The Password Program"print "Copyright 2005 Nathan Pinno."printanswer = raw_input("What is the password? ")while passwo

Re: [Tutor] Why is this error showing up? (Original Message: (Tutor) What's wrong with this code?) Ignore previous post.

2005-07-07 Thread Nathan Pinno
Thanks Wolfram for help with that error. Here's another that popped up: Traceback (most recent call last): File "D:\password.py", line 68, in ? for x in site.keys(): AttributeError: 'str' object has no attribute 'keys' How t

Re: [Tutor] Why is this error showing up? (Original Message: (Tutor) What's wrong with this code?) Ignore previous post.

2005-07-07 Thread Nathan Pinno
error showing up? (Original Message: (Tutor) What's wrong with this code?) Ignore previous post. > Hi! > > > on Thu, 7 Jul 2005 01:13:48 -0600 "Nathan Pinno" <[EMAIL PROTECTED]> wrote : > ------

[Tutor] Why does invalid syntax pop up?

2005-07-07 Thread Nathan Pinno
Hi all,   Why does invalid syntax popup?   Here is the latest code: # This is the code for a password protected program to store passwords.password = "hello"print "The Password Program"print "Copyright 2005 Nathan Pinno."printanswer = raw_

Re: [Tutor] Why does invalid syntax pop up?

2005-07-07 Thread Nathan Pinno
Here is the error: File "D:\password.py", line 45 site = raw_input("Site: ") ^ SyntaxError: invalid syntax HTH, Nathan Pinno - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[E

Re: [Tutor] Why does invalid syntax pop up?

2005-07-07 Thread Nathan Pinno
Here is another error message: Traceback (most recent call last): File "D:\password.py", line 69, in ? main_menu() NameError: name 'main_menu' is not defined Thanks. - Original Message ----- From: "Nathan Pinno" <[EMAIL PROTECTED]>

Re: [Tutor] Why does invalid syntax pop up?

2005-07-07 Thread Nathan Pinno
Here is the latest code, in case you need it: # This is the code for a password protected program to store passwords. password = "hello" print "The Password Program" print "Copyright 2005 Nathan Pinno." print answer = raw_input("What is the pass

Re: [Tutor] Why does invalid syntax pop up?

2005-07-08 Thread Nathan Pinno
Thanks, Danny and all. Adjusted the code, here is the newest code and error: # This is the code for a password protected program to store passwords. password = "hello" print "The Password Program" print "Copyright 2005 Nathan Pinno." print answer = r

Re: [Tutor] Why does invalid syntax pop up? (fwd)

2005-07-09 Thread Nathan Pinno
one is interested in finishing it, just give me a shout, and I'll send it to you as a ZIP file. Thanks, Nathan Pinno Crew, McDonalds Restaurant, Camrose, AB, Canada http://www.npinnowebsite.ca -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian va

[Tutor] Is it possible to...

2005-07-09 Thread Nathan Pinno
Hi all,   I was just wondering if it is possible to use Python as a language to password protect a webpage? If it is possible, I wouldn't mind learning how, it would enable me to add a member-only section to my website.   Thanks, Nathan PinnoCrew, McDonalds Restaurant, Camrose, AB Canadahttp:/

[Tutor] What's the invalid syntax?

2005-07-09 Thread Nathan Pinno
What's the invalid syntax?   Here's the code (Part of my Guess the Numbers game):       if a0 == x0 and a1 == x1 and a2 == x2 and a3 == x3:    print "Congratulations! Way to go?"    answer = raw input("Play again: (Y)es or (N)o Type the letter of your choice. ")   Thank

Re: [Tutor] Is it possible to...

2005-07-09 Thread Nathan Pinno
Could you send me the code if possible, or show me the way to go? - Original Message - From: "nephish" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Sent: Saturday, July 09, 2005 12:32 PM Subject: Re: [Tutor] Is it possible to...

[Tutor] Can I use def without ( ) at the end?

2005-07-09 Thread Nathan Pinno
Hi all,   Is the subject possible without getting an error?   Nathan PinnoCrew, McDonalds Restaurant, Camrose, AB Canadahttp://www.npinnowebsite.ca/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Can I use def without ( ) at the end?

2005-07-09 Thread Nathan Pinno
t make the code easier to read, but harder to code because I have to keep going to the top to read the menu. Not that fun, but necessary for a smooth program, I guess. Nathan Pinno - Original Message - From: "Brian van den Broek" <[EMAIL PROTECTED]> To: &

Re: [Tutor] Can I use def without ( ) at the end?

2005-07-09 Thread Nathan Pinno
Also, I just wanted to know because I'm using it in my Giant Computer program for the menus, so I don't have to keep re-typing them. Nathan Pinno - Original Message - From: "Brian van den Broek" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EM

Re: [Tutor] Can I use def without ( ) at the end?

2005-07-09 Thread Nathan Pinno
Brian, I'll do one better and post the code after I'm done writing it. Then you can decide for yourself what I'm trying to do. Nathan P. - Original Message - From: "Brian van den Broek" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMA

[Tutor] What's going on with this code? Error message supplied.

2005-07-09 Thread Nathan Pinno
Here is the error message:   Traceback (most recent call last):  File "D:\GC.py", line 67, in ?    if option == 1:NameError: name 'option' is not defined And the relevant code:   print "The Giant Calculator"printprint "Copyright 2005 Written and debugged by

[Tutor] Looks like Giant Calc is a bust.

2005-07-09 Thread Nathan Pinno
uot;4) Convert Celsius to Kelvins"    print "5) Convert Kelvins to Fahrenheit"    print "6) Convert Fahrenheit to Kelvins"    print "7) Main Menu"    temp_option = input("Choice: ")   def formula_menu():    print "1) Interest"    print &quo

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

2005-07-10 Thread Nathan Pinno
I fixed this bug by myself, I had forgotten to add a print on a line by itself. - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Sunday, July 10, 2005 12:29 AM Subject: Re: [

Re: [Tutor] Another newbie question from Nathan.

2005-07-10 Thread Nathan Pinno
t make the code easier to read, but harder to code because I have to keep going to the top to read the menu. Not that fun, but necessary for a smooth program, I guess. Nathan Pinno "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On

Re: [Tutor] What's going on with this code? Error message supplied.

2005-07-10 Thread Nathan Pinno
rror? Nathan - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Sunday, July 10, 2005 2:16 AM Subject: Re: [Tutor] What's going on with this code? Error message supplied. > Nath

[Tutor] Why does my code show this?

2005-07-10 Thread Nathan Pinno
Hey all,   Thought I'd try a mini-calc. Here's the code:   # This is a small calculator.print "Mini Calculator"print "By Nathan Pinno"printprint "CALCULATE MENU"print "1) Add"print "2) Subraction"print "3) Mult

Re: [Tutor] Why does my code show this?

2005-07-10 Thread Nathan Pinno
Thanks to all in the group. Mini_calc is now up and running successfully and is now available to download from my site. Thanks again, Nathan - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sen

[Tutor] Giant Calc runs, but need advice on how to make the menu repopup.

2005-07-12 Thread Nathan Pinno
It runs but now how do I make it go back to the previous menu (e.g. from Add to Calculate Menu?)   Here is the latest screenshot:   The Giant Calculator   Copyright 2005 Written and debugged by Nathan Pinno   OPTIONS MENU1) Calculate2) Shapes3) Temperature4) Formulas5) QuitWhat option would

[Tutor] Just finished creating Shape_Calc.

2005-07-17 Thread Nathan Pinno
Hey all,   Just finished shape_calc.py. If anyone is interested in going through the code, before I send it to my website, let me know. If no one answers this within a week, I post the zip file on my site.   Nathan Pinno. ___ Tutor maillist

Re: [Tutor] Just finished creating Shape_Calc.

2005-07-17 Thread Nathan Pinno
Luke and all,   Shape_calc helps you to find the area, perimeter, and other info about shapes.   Simple enough. - Original Message - From: luke To: Nathan Pinno Sent: Sunday, July 17, 2005 9:42 PM Subject: Re: [Tutor] Just finished

[Tutor] I am going to change Giant Calculator into mini calculators.

2005-07-17 Thread Nathan Pinno
Hey all,   The subject says it all. If anyone is interested in working on Giant Calculator, give me a shout, and I'll send you a ZIP file with the PY file.   Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tuto

Re: [Tutor] Who uses input()? [was Re: question on "input"]

2005-07-18 Thread Nathan Pinno
Terry and all, I thought something like this might popup. I find it easier to remember and faster to code than int(raw_input()). The faster I can code a program, the better in my opinion. So what if it has a few bugs, I fix them gradually. Nathan Pinno - Original Message

Re: [Tutor] Who uses input()? [was Re: question on "input"]

2005-07-18 Thread Nathan Pinno
example. If there is, show me it, please. I'm getting confused writing my MasterMind and don't want to screw up bad, e.g. repeat the same answer in a different way. Thanks, Nathan Pinno. - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]>

Re: [Tutor] shape_calc.py

2005-07-18 Thread Nathan Pinno
Raj,   Shape_calc is a calculator for finding information about shapes, e.g. perimeter, area, and so forth.   HTH (Hope This Helps), Nathan Pinno - Original Message - From: Raj Moodley To: [EMAIL PROTECTED] Sent: Monday, July 18, 2005 2:54

Re: [Tutor] shape_calc.py

2005-07-18 Thread Nathan Pinno
on a MasterMind-like game, but it giving me headaches :).   Nathan Pinno. P.S. Enjoy the shape_calc. You can find Mini_calc and Guess the Number on my site at this address: http://www.npinnowebsite.ca/download.htm. - Original Message - From: Raj Moodley

[Tutor] Which is safer and easier to code, raw_input or int(raw_input))?

2005-07-18 Thread Nathan Pinno
Hi all,   The subject line says it all. What's the answer?   Let's let everyone talk about this.   Nathan Pinno. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Which is safer and easier to code, raw_input or int(raw_input))?

2005-07-18 Thread Nathan Pinno
hat I don't miss any.   Nathan Pinno - Original Message - From: luke To: Nathan Pinno Sent: Monday, July 18, 2005 11:44 AM Subject: Re: [Tutor] Which is safer and easier to code,raw_input or int(raw_input))? tmp = raw_input("hello,

Re: [Tutor] shape_calc.py

2005-07-20 Thread Nathan Pinno
ifications I have made to your code if you're > interested. Don't mean to correct you or to stole your app, only suggestions > and ideas > > Best Regards to you > > Alberto > >>From: "Nathan Pinno" <[EMAIL PROTECTED]> >>To: &

[Tutor] Thanks.

2005-07-26 Thread Nathan Pinno
Thanks all for helping me. Thanks to the group, I have figured out a way to make Giant Calculator and any program repeat until the user wants to exit.   Thanks again, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman

[Tutor] How do I make Python draw?

2005-07-27 Thread Nathan Pinno
How do I make Python draw a shape? e.g. a triangle Is there a specific module that I have to call, or what is the command(s)?   Thanks, Nathan Pinno   P.S. Knowing this will help me make my shape_calc program better. ___ Tutor maillist - Tutor

[Tutor] How do I go about this?

2005-07-27 Thread Nathan Pinno
for the help, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I go about this?

2005-07-27 Thread Nathan Pinno
Luis and all,   I want to more than matching, I am trying to find all the available combos, e.g a1 == x1 or a1 == x2 or a1 != x1.   HTH, Nathan Pinno    I also noticed you forgot the a[1] == b[1]. (grin) :)   - Original Message - From: Luis N To: tutor@python.org Sent

Re: [Tutor] How do I make Python draw?

2005-07-27 Thread Nathan Pinno
Thanks. Will ask if I have any more questions. Maybe I won't have to go to Visual Basic to write my games. Maybe Python will do the trick. Thanks again. Nathan Pinno - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAI

[Tutor] Why does this NameError appear?

2005-07-27 Thread Nathan Pinno
ot defined Thanks in advance, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I make Python draw?

2005-07-27 Thread Nathan Pinno
Luke, Thanks for the reminder. Though I might try Java, but having problems with errors left, right and center. G2G, Nathan - Original Message - From: "luke" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Danny Yoo" <[EMAIL PR

Re: [Tutor] How do I make Python draw?

2005-07-27 Thread Nathan Pinno
Pygame looks solid. I'm sold on it. Maybe I'll be able to code my Guess the Number Sequence Game with it using Python. - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, July 27

Re: [Tutor] How do I go about this? [was Re: Who uses input()? [was Re: question on "input"]]

2005-07-27 Thread Nathan Pinno
I first posted my question in this post, but no one seemed to answer me. - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Danny Yoo" <[EMAIL PROTECTED]> Cc: ; "Terry Reedy" <[EMAIL PROTECTED]> Sent: Monday, July 18,

[Tutor] I'm stumped.

2005-07-27 Thread Nathan Pinno
stb:  print item,other   Thanks in advance, Nathan Pinno ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I go about this? [was Re: Who uses input()? [was Re: question on "input"]]

2005-07-27 Thread Nathan Pinno
Here's part of what I'm looking for (got it from a Python program): a b a 2 a 5 a 6 1 b 1 2 1 5 1 6 3 b 3 2 3 5 3 6 4 b 4 2 4 5 4 6 I want to see also !=, ==, and, & nor combos also. 0 != 2 for an example. - Original Message - From: "Danny Yoo" <[EMAIL PR

Re: [Tutor] I'm stumped.

2005-07-27 Thread Nathan Pinno
Thanks. Now it basically works. Now I just have to improve it. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Wednesday, July 27, 2005 6:06 PM Subject: Re: [Tutor] I'm stumped. > Try t

Re: [Tutor] OT: we won't eat VB programmers for lunch [Was: How doI make Python draw?]

2005-07-27 Thread Nathan Pinno
Now that's worth the mention of VB. Glad I have Python, or many of my ideas would stay in my head...hehehe - Original Message - From: "luke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Tutor" Sent: Wednesday, July 27, 2005 6:28 PM Subject: Re: [Tutor] OT: we won't eat VB programmers fo

Re: [Tutor] I'm stumped.

2005-07-27 Thread Nathan Pinno
It works. The program will be found on my webpage at it's new address http://falcon3166.tripod.com in the Downloads page. - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Alan G" <[EMAIL PROTECTED]>; Sent: Wednesday, July 27,

Re: [Tutor] OT: we won't eat VB programmers for lunch [Was: How doImake Python draw?]

2005-07-29 Thread Nathan Pinno
I got it Alan. It was good. Thanks. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor" Sent: Thursday, July 28, 2005 4:15 AM Subject: Re: [Tutor] OT: we won't eat VB programmers for lu

[Tutor] How do I get rid of blank space when running a program I've coded?

2005-07-30 Thread Nathan Pinno
Hi all,   I'll be brief. I always get a blank line whenever I run my Python programs that I've coded. How can I get rid of it. It's kind of annoying to press the spacebar in order to return to >>> in IDLE or the C:\ prompt in DOS.   Thanks, Nathan _

Re: [Tutor] How do I get rid of blank space when running a program I'vecoded?

2005-07-30 Thread Nathan Pinno
I meant the return key, not the spacebar. Sorry for the mix-up. - Original Message - From: Nathan Pinno To: tutor@python.org Sent: Saturday, July 30, 2005 3:50 PM Subject: [Tutor] How do I get rid of blank space when running a program I'vecoded? H

[Tutor] What's the invalid synax? Error message and code supplied.

2005-07-30 Thread Nathan Pinno
Here's the message:   File "D:\Python22\prog4.py", line 19    while option != 9:    ^SyntaxError: invalid syntax And the code: #This program finds the area and perimeter of circles, rectangles, and squares.def menu():    print '1) Area (Circle)'    print '2) Area (Rectangle)'    print '

Re: [Tutor] What's the invalid synax? Error message and codesupplied.

2005-07-30 Thread Nathan Pinno
; (Once > you have it working). > > Happy Debugging > > --Todd > > > On Saturday 30 July 2005 06:19 pm, Nathan Pinno wrote: >> Here's the message: >> File "D:\Python22\prog4.py", line 19 >> while option != 9: >> ^ >> S

[Tutor] How do I make a Python program keep repeating?

2005-07-30 Thread Nathan Pinno
Hi all,   How do I make a program keep repeating until the user is done with it?   Thanks, Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] When I run this code, it just keeps repeating.

2005-07-30 Thread Nathan Pinno
When I run the following code it just keeps repeating. Here is a screen shot showing what I mean: Mini CalculatorBy Nathan Pinno   CALCULATE MENU1) Add2) Subraction3) Multiplication4) Division w/o remainder5) Division with remaider6) Exponation7) Square roots9) ExitOption: 5First number

Re: [Tutor] When I run this code, it just keeps repeating.

2005-07-30 Thread Nathan Pinno
loop again. > > Another comment - the global cal_opt is considered evil by many. Better > would > be: > > def cal(): > return int(raw_input("Option: ")) > > print "Mini Calculator" > print "By Nathan Pinno" > print > >

[Tutor] Now what do I do?(was Re: When I run this code, it just keeps repeating.)

2005-07-30 Thread Nathan Pinno
Here is another screen shot: Mini Calculator By Nathan Pinno CALCULATE MENU 1) Add 2) Subraction 3) Multiplication 4) Division w/o remainder 5) Division with remaider 6) Exponation 7) Square roots 9) Exit Option: 3 First number:4 Second number:6 4 * 6 = 24 CALCULATE MENU 1) Add 2) Subraction 3

Re: [Tutor] How do I get rid of blank space when running a program I'vecoded?

2005-07-30 Thread Nathan Pinno
hat you want to run by double-clicking them but you can take it > out if you find it annoying. > > Kent > > Nathan Pinno wrote: >> I meant the return key, not the spacebar. Sorry for the mix-up. >> >> - Original Message - >> *From:* Nathan Pi

Re: [Tutor] Now what do I do?(was Re: When I run this code, it just keeps repeating.)

2005-07-30 Thread Nathan Pinno
Glad I didn't put up my mini calculator apps on my site. Would have had complaints from people. But this thread has given me ideas on how to fix them all, and how to fix Giant Calculator as well. - Original Message - From: "Reed L. O'Brien" <[EMAIL PROTECTED]>

[Tutor] Help with file I/O.

2005-07-30 Thread Nathan Pinno
If anyone will help me learn file I/O, it would be appreciated. I went through Josh Cogliani's Non-Programmer's Tutorial for Python, and I still can't understand it.   Thanks in advance, Nathan Pinno ___ Tutor maillist - Tutor@

Re: [Tutor] cant get started

2005-07-30 Thread Nathan Pinno
This is an easy one. Go to the IDLE, I found it was easier. The latest Python refused to work on mine, so I'm using 2.2.3, and it works fine. - Original Message - From: [EMAIL PROTECTED] To: tutor@python.org Sent: Friday, July 29, 2005 10:22 PM Subject: [Tutor] cant g

Re: [Tutor] Help with file I/O.

2005-07-30 Thread Nathan Pinno
Well, you saw my password program. That was my first attempt at using file I/O. Thought I'd try it big time. You saw where that went. Nathan - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Cc: Sent: S

Re: [Tutor] How do I make a Python program keep repeating?

2005-07-31 Thread Nathan Pinno
I'd post another code, but I've already figured it out, thanks to help on the mini calc program. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Sunday, July 31, 2005 2:03 AM Subject: Re: [

Re: [Tutor] Help with file I/O.

2005-07-31 Thread Nathan Pinno
Here's my work. I call it filewriter. The code: file = raw_input("File name please: ") f = file(file, "r") for line in f.readlines(): print line f.close() Will it do the trick? Nathan - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]

Re: [Tutor] Help with file I/O.

2005-07-31 Thread Nathan Pinno
understand. ----- Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Danny Yoo" <[EMAIL PROTECTED]> Cc: Sent: Sunday, July 31, 2005 2:29 PM Subject: Re: [Tutor] Help with file I/O. > Here's my work. I call it filewriter. > The code: > file

Re: [Tutor] Help with file I/O.

2005-07-31 Thread Nathan Pinno
Here's the improved version. file = raw_input("File name please: ") f = open(file) for line in f.readlines(): print line f.close() - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Danny Yoo" <[EMAIL PROTECTED]> Cc:

Re: [Tutor] Help with file I/O.

2005-07-31 Thread Nathan Pinno
Okay I understand how to open and read to a file, but how do I write to a file, e.g. a list. - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Danny Yoo" <[EMAIL PROTECTED]> Cc: Sent: S

[Tutor] Thanks to all!

2005-07-31 Thread Nathan Pinno
Thank you to all. All my calculators run perfect. I can now make a perfect Giant Calculator as well.   Thanks again, Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Thanks to all!

2005-07-31 Thread Nathan Pinno
The Giant Calculator is perfect also! - Original Message - From: Nathan Pinno To: tutor@python.org Sent: Sunday, July 31, 2005 3:34 PM Subject: [Tutor] Thanks to all! Thank you to all. All my calculators run perfect. I can now make a perfect Giant Calculator

Re: [Tutor] Help with file I/O.

2005-07-31 Thread Nathan Pinno
write the main part of a password program, then when that's solid, I'll add the file I/O. Maybe I'll try the exercise where I have to add file I/O to a grades program, in the Non-Programmer's Tutorial for Python. - Original Message - From: "luke" <[EMAIL PROT

Re: [Tutor] Thanks to all!

2005-07-31 Thread Nathan Pinno
ct: Re: [Tutor] Thanks to all! > > Congratulations! So what are you going to try next? > > --Todd > > On Sunday 31 July 2005 06:27 pm, Nathan Pinno wrote: >> The Giant Calculator is perfect also! >> - Original Message - >> From: Nathan Pinno >>

[Tutor] What's the invaild syntax? Error message and relative code supplied.

2005-07-31 Thread Nathan Pinno
What the invalid syntax? Here is the error message: SyntaxError: invalid syntax  File "D:/Python22/grades.py", line 66    which = which-1    ^SyntaxError: invalid syntax   Here is the code:   max_points = [25,25,50,25,100]assignments = ['hw ch 1','hw ch 2','quiz   ','hw ch 3','test']stud

Re: [Tutor] What's the invaild syntax? Error message and relativecode supplied.

2005-07-31 Thread Nathan Pinno
Take a look at the line before the one you are getting the error on. > And count the ('s and the )'s. > > --Todd > > > > On Sunday 31 July 2005 07:38 pm, Nathan Pinno wrote: >> What the invalid syntax? Here is the error message: >> SyntaxError: invalid synt

Re: [Tutor] What's the invaild syntax? Error message and relative codesupplied.

2005-07-31 Thread Nathan Pinno
Thanks again Luke. - Original Message - From: "luke" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Sunday, July 31, 2005 5:50 PM Subject: Re: [Tutor] What's the invaild syntax? Error message and relative codesupplied. >

Re: [Tutor] Help with file I/O.

2005-07-31 Thread Nathan Pinno
Does it display stars instead? - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Alberto Troiano" <[EMAIL PROTECTED]>; "Danny Yoo" <[EMAIL PROTECTED]>; "luke" <[E

Re: [Tutor] What's the invaild syntax? Error message and relative codesupplied.

2005-07-31 Thread Nathan Pinno
Hey, looks like this is my problem. ) I'll just have to be more careful in the future. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; Sent: Sunday, July 31, 2005 6:24 PM Subject: Re: [Tutor] What&#x

[Tutor] Is input a Python function or command?

2005-07-31 Thread Nathan Pinno
Is input a Python function or command? I need to know because I'm planning to use it as a variable, and don't want to get an error.   Thanks, Nathan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is input a Python function or command?

2005-07-31 Thread Nathan Pinno
Thanks Luke. Saved me quite a headache. I will use in_file instead. Makes more sense anyway. - Original Message - From: "luke p" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]> Sent: Sunday, July 31, 2005 7:59 PM Subject: Re: [Tutor] Is in

Re: [Tutor] Is input a Python function or command?

2005-08-01 Thread Nathan Pinno
Just remembered that input is for integers! Oops! Shouldn't have asked! And in_file makes more sense because I'm loading a file with it. - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Luke P" <[EMAIL PROTECTED]> Cc: "Tut

[Tutor] I've run into a jam on the exercise on file I/O

2005-08-01 Thread Nathan Pinno
grade    elif which != -1:    print "Invalid Grade Number"    else:    print "Student not found"    elif menu_choice == 5:    filename = raw_input("Filename to load: ")    load_grades(students,filenam

Re: [Tutor] I've run into a jam on the exercise on file I/O

2005-08-01 Thread Nathan Pinno
Maybe I should use assignments instead? - Original Message - From: Adam Bark To: Nathan Pinno Cc: tutor@python.org Sent: Monday, August 01, 2005 2:47 PM Subject: Re: [Tutor] I've run into a jam on the exercise on file I/O >>> max_points = [2

[Tutor] Question

2005-08-01 Thread Nathan Pinno
Hi all,   Just curious to wonder if Python can be used to write a program to check an HTTP mail server for mail, and check more than one server, even if they are using different proxies, i.e. HTTP for one and SMTP for the other.   Thanks, Nathan Pinno,Crew, Camrose McDonalds and owner

Re: [Tutor] I've run into a jam on the exercise on file I/O

2005-08-01 Thread Nathan Pinno
What if I were to use ID's for the students and use the ID's as the sequence index, and link the students and their grades to the IDs? Just a suggestion, Nathan Pinno - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: "Nathan Pinno" &

[Tutor] I need advice.

2005-08-01 Thread Nathan Pinno
Hey all,   I want to write a program that will convert time in any other time zone to my time zone. Would it be better to use the Python time molecule or just a whole bunch of if statements?   Waiting eagerly for an answer, Nathan Pinno,Crew, Camrose McDonalds and owner/operator of Woffee

[Tutor] Question about BASIC and Python

2005-08-01 Thread Nathan Pinno
Hi all,   I had a co-worker say to me at work that Python was related to or based upon BASIC. Is this true, and if not, how can I tell my friend why they are similar?   Nathan Pinno,Crew, Camrose McDonalds and owner/operator of Woffee BEGIN:VCARD VERSION:2.1 N:Pinno;Nathan;Paul;Mr. FN:Pinno

Re: [Tutor] Question about BASIC and Python

2005-08-01 Thread Nathan Pinno
Thanks Bob and Liam. I was wondering myself. - Original Message - From: Bob Gailer To: Nathan Pinno ; Tutor mailing list Sent: Monday, August 01, 2005 11:09 PM Subject: Re: [Tutor] Question about BASIC and Python At 06:13 PM 8/1/2005, Nathan Pinno wrote

Re: [Tutor] I need advice.

2005-08-01 Thread Nathan Pinno
I forgot to tell that I use Python 2.2.3. When I first got Python, I got 2.4.1, but it refused to run the second time. So I went and got 2.2.3. Your answer would make sense if I had 2.4.1, but I don't. - Original Message - From: "Danny Yoo" <[EMAIL PROTECTED]> To: &

Re: [Tutor] I need advice.

2005-08-02 Thread Nathan Pinno
I think I'll leave this one for someone else. I got too confused too quick. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor mailing list" Sent: Tuesday, August 02, 2005 1:47 AM Sub

[Tutor] Question about resetting values

2005-08-02 Thread Nathan Pinno
I am writing a Blackjack program, and was wondering how to reset the values to zero, e.g. cash = 0?   Thanks, Nathan Pinno,Crew, Camrose McDonalds and owner/operator of Woffee BEGIN:VCARD VERSION:2.1 N:Pinno;Nathan;Paul;Mr. FN:Pinno, Nathan Paul ORG:Woffee;Executive TITLE:Owner/operator TEL

Re: [Tutor] I need advice.

2005-08-02 Thread Nathan Pinno
I am now using Python 2.4.1, but decided to abandon it. It got too confusing too fast. I'm better off writing simple games and apps for now. - Original Message - From: "Nathan Pinno" <[EMAIL PROTECTED]> To: "Danny Yoo" <[EMAIL PROTECTED]> Cc: "

Re: [Tutor] Question about resetting values

2005-08-02 Thread Nathan Pinno
Never mind all. I was just being stupid as usual. I thought that there might be a Python command for resetting and wanted to find out if that was the case. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "Nathan Pinno" <[EMAIL PROTECTED]&

[Tutor] I need advice about which way to go.

2005-08-02 Thread Nathan Pinno
is the right and correct way to go? Also for blackjack, I want to use it as playertotal = playertotal + n, and computertotal = computertotal + n. or 1,2,3, etc. Which is better?   Thanks, Nathan Pinno,Crew, Camrose McDonalds and owner/operator of Woffee BEGIN:VCARD VERSION:2.1 N:Pinno;Nathan

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Nathan Pinno
igured out separately. The two games are indeed separate, too much trouble to do them a 1 program that can play both games. Maybe I should have shown my code and asked using the code as a visual reference. - Original Message - From: "Alan G" <[EMAIL PROTECTED]> To: "

Re: [Tutor] I need advice about which way to go.

2005-08-03 Thread Nathan Pinno
aw_input("Menu choice: "))   def card_choice():    return random.choice(range(1,14)   def types():    return random.choice(range(1,5)   def player_cards():    print a," of ",t1    print b," of ",t2   print "Blackjack"print "By Nathan Pinno"while 1: 

  1   2   3   >