python 3 error i know the file works in python 2.6

2009-02-05 Thread garywood
can someone help me please #open file and read last names filename = input('name file') file = open(filename, 'r') names_list = file.readlines() file.close() #open a file for saving passwords outfile_name = input('Save passwords') outfile = open(outfile_name, 'a') #create a password for each n

is there a shorter way to write this

2009-01-29 Thread garywood
I had a task in a book to pick 5 items from a list of 26 ensuring the items are not repeated import random list = ['a','b','c','d','e','f','g','h','i','j','k','l','m', 'n','o','p','q','r','s','t','u','v','w','x','y','z'] word = ' ' a = random.choice(list) list.remove(a) b = random.choice

can someone tell me why this doesn't work please python 3

2009-01-14 Thread garywood
def ask_ok(prompt, retries=4, complaint="Yes or no, please!"): while True: password = input("enter something") if password in ('y', 'ye', 'yes'): return True if password in ('n', 'no', 'nope'): return False retries = retries - 1 if retries < 0:

just got the g1

2008-12-11 Thread garywood
Hi Just got the G1, is their any way to get python running on the andriod platform ? -- http://mail.python.org/mailman/listinfo/python-list

hi can someone help me i would like to run this program 3 times and would like to append the cPickle file as a high score table

2008-10-09 Thread garywood
hi, Can someone help me i would like to run this program 3 times or more and would like to append the cPickle file as a high score table keeping my top scores. Right now it only records the last score thanks. # Trivia Challenge # Trivia game that reads a plain text file def open_file(file_n

can someone explain why this happens- newbie question

2008-09-30 Thread garywood
Hi can someone tell me why it prints the high score table multiple times? #high scores program scores =[] choice = None while choice != 0: print """high Score Table 0 - exit 1 - show Scores 2 - add a score 3 - delete a score 4 - sort scores """

has anyone completed python for the absolute beginner ?

2008-08-16 Thread garywood
has anyone completed python for the absolute beginner ? chapter 7 in the book the trivia_challenge.py file does not work correctly and does not display all the correct questions - and even though the answer is correct it will still state the answer is wrong. this file is from the CD i have not

very newbie question

2008-08-07 Thread garywood
stuck on python for absolute beginners chapter 6 i actually done what i was supposed to do use the function ask_number for guess a number but for some reason it does not count correctly the number of tries # Guess My Number # # The computer picks a random number between 1 and 100 # The player

[no subject]

2008-06-05 Thread garywood
Hi there. So I have a challenge in the Python book I am using (python programming for the absolute beginner) that tells me to improve an ask_number() function, so that it can be called with a step value, and I havn't been able to find out yet what's meant by a step value, but i'll keep looking of c

for some reason the actual tries figure is not right

2008-05-24 Thread garywood
can someone explain why the tries displays the wrong number thanks orginally i started off with tries = 0 but it was off by 2 # Word Jumble # # The computer picks a random word # The player has to guess the original word can give hint import random tries = 1 # create a sequence of words to

can someone with guessing a number

2008-05-21 Thread garywood
I would just like the program to exit after guessing the amount of numbers wrong # Guess My Number import random the_number = random.randrange(100) + 1 tries = 1 # guessing loop while (guess != the_number): if (guess > the_number): print "Lower..." else: print "Higher..