Text Auto-fill

2005-11-07 Thread ChuckDubya
It's common in web browsers to have a text auto-fill function for
personal information or passwords or whatnot.  The flavor that I'm
referring to is the kind that pops up as you're typing the word, not
the kind that fills text fields before typing has started.

Well I want to know how to do that in Python.  I'm looking to edit IDLE
so that it doesn't take me forever to code four lines.

Eventually, I want to create a Visual Basic-type environment for
myself.  I'm a moron, and I need all the coding help I can get.

-- 
http://mail.python.org/mailman/listinfo/python-list


Newbie: Help Figger Out My Problem

2005-06-28 Thread ChuckDubya
##Coin Flip: randomly flips 100 "coins" and prints results
##Original draft: june 27, 2005
##Chuck

import random
heads = 0
tails = 0
flips = 0
while flips < 99:
coin = random.randrange(0, 2)
if coin == 0:
heads = heads + 1
else:
tails = tails + 1
flips = flips + 1
if flips >= 99:
print "Heads: " + heads
print "Tails: " + tails
print "Total: " + flips + "flips"
raw_input("Press the enter key to exit.")



When I save and run this "program", I get a DOS window that flashes at
me and disappears.  What's wrong with it?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: Help Figger Out My Problem

2005-06-28 Thread ChuckDubya
Thanks to all who replied.  I did not ask for other iterations of my
program.  I asked what was wrong with it.  To those who did just that,
explained what was wrong, thank you for answering my question.

-- 
http://mail.python.org/mailman/listinfo/python-list


Newbie: Explain My Problem

2005-06-29 Thread ChuckDubya
Code:

#The Guess My Number Game

import random
num = ""
guess = ""
counter = 7
num = random.randrange(1, 100)
print "I'm thinking of a whole number from 1 to 100."
print "You have ", counter, " chances left to guess the number."
print
guess = int(raw_input("Your guess is: "))
while counter != 0:
if guess == num:
print "You guessed the number, ", num, " in ", counter-6, "
guesses!"
elif guess > num:
counter = counter - 1
print
print "The number is less than your guess."
print "You have ", counter, " chances left to guess the
number."
guess = int(raw_input("Your guess is: "))
else:
counter = counter - 1
print
print "The number is greater than your guess."
print "You have", counter, " chances left to guess the number."
guess = (raw_input("Your guess is "))
if counter == 0:
print "You idiot, my number was", num,"!"
print "YOU LOSE!"
raw_input("Hit the enter key to exit.")


Two things wrong happen:
- Dialogue switches from saying "number is greater" to "number is
less", regardless of guess
- Lets user guess when user has no more guesses left in "counter"
variable.

Please explain to me what's wrong with my program.

-- 
http://mail.python.org/mailman/listinfo/python-list


Making programs work together.

2005-08-16 Thread ChuckDubya
I'm looking to make what's basically a macro for a computer game.  But
I want this "macro" to take information from the game itself, so it's
not really a macro.

How do I access the data from my game to use in a program?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Making programs work together.

2005-08-16 Thread ChuckDubya
Example: I'm driving a car in a game and I hit an oil slick so instead
of me having to lift off the throttle button on the keyboard, I want to
make a program to disengage the throttle as long as I'm on that oil
slick.  Does that clear anything up?

-- 
http://mail.python.org/mailman/listinfo/python-list