[Tutor] Dictionaries

2012-06-17 Thread Selby Rowley-Cannon
Hello,             I am having a problem with a small application I am writing. I have to have the user input the key, then have the program output the value associated with it. A way to inform the user that the key they entered is not in the dictionary or somefing would be nice also. Fank you

[Tutor] Dictionary

2012-06-17 Thread Selby Rowley-Cannon
Version: 2.7 OS: Ubuntu 12.04 LTS I am writing a small translation app for Rydish (A language that exists in the same way Klingon does, invented by my company for a[n] RPG). Here is my current method of translation: Edictionary = {'English keys':'Rydish values'} TextEng = raw_input('Please ent

[Tutor] (no subject)

2012-06-19 Thread Selby Rowley-Cannon
Mailing list;         I have a small, [for the most part] functioning translation app for Rydish, a language created for the sole purpose of an RPG. The only problem is when I enter a word that has not yet been translated, I get this error: Traceback (most recent call last):   File "translator.p

[Tutor] check against multiple variables

2012-07-19 Thread Selby Rowley-Cannon
I am using a hash table in a small randomization program. I know that some hash functions can be prone to collisions, so I need a way to detect collisions. The 'hash value' will be stored as a variable. I do not want to check it against each singular hash value, as there will be many; I need a w

[Tutor] Script won't run for no apparent reason

2012-08-10 Thread Selby Rowley Cannon
I have written a small application to encrypt some text. The script looks fine to me, but it won't run and I can't figure out why. I have attached it, if anyone knows why it doesn't work please let me know! #!/usr/bin/env python3 import random values = {'a':'d', 'b':'e', 'c':'f', 'd':'g', 'e':'h

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Selby Rowley Cannon
On 10/08/12 20:07, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 2:57 PM, Selby Rowley Cannon wrote: On 10/08/12 18:17, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley Cannon wrote: I have written a small application to encrypt some text. The script looks fine to me, but

Re: [Tutor] Script won't run for no apparent reason

2012-08-10 Thread Selby Rowley Cannon
On 10/08/12 20:53, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 3:33 PM, Selby Rowley Cannon wrote: On 10/08/12 20:07, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 2:57 PM, Selby Rowley Cannon wrote: On 10/08/12 18:17, Joel Goldstick wrote: On Fri, Aug 10, 2012 at 1:05 PM, Selby Rowley

[Tutor] (no subject)

2012-08-19 Thread Selby Rowley Cannon
OK, I have some code, and it uses glob.glob('*.py') to find all the python files in the current directory. Just thought i'd ask, would: glob.glob('C:\*.py') (Windows), or glob.glob('/*.py') (*nix) find all the python files on the system? Thanks ___ T

[Tutor] Website form data input

2012-10-06 Thread Selby Rowley-Cannon
Hello,      I am aiming to write a program that inputs a list of codes into an HTML text field, one by one, entering the next code if it is incorrect, but stopping when the code is correct. I've got down putting the codes into a list, and 'for' looping though it (maybe 'while' the entered code

[Tutor] LCM

2012-11-14 Thread Selby Rowley Cannon
Hey, I've been trying to write a function to find the Lowest Common Multiple of two numbers, but it isn't working and I've kinda hit a dead end on the thought-process end of things. Anyone mind looking at it, and tell me what's wrong? (I hop you don't think it's too long to put in an emai

Re: [Tutor] LCM

2012-11-14 Thread Selby Rowley Cannon
On 14/11/12 18:27, Dave Angel wrote: On 11/14/2012 12:52 PM, Selby Rowley Cannon wrote: Hey, I've been trying to write a function to find the Lowest Common Multiple of two numbers, but it isn't working and I've kinda hit a dead end on the thought-process end of things. Anyo