[Tutor] Eek, help!
cyresse at gmail.com
Sun Nov 7 09:21:40 CET 2004
Jacob - this is anyKey()
if prompt is None:
prompt = "Press any key"
while not msvcrt.kbhit(): # kbhit() returns 1 (true) or 0
(false), true if any key is pressed
But, it was as Danny said, my while loop was always true, which is
odd, because, I had copied this -
filename = 'addbook.dat'
store = file(filename,'r')
name = store.readline().strip()
entry = store.readline().strip()
book[name] = entry
store = file(filename,'w') # create new empty file
from Alan Gauld's tutorial, and it works fine... so Liam == confused is True.
But thanks all round,
On Sat, 6 Nov 2004 20:29:25 -0500, Jacob S. <keridee at jayco.net> wrote:
> Just a quick question. How did you define your function? What is pause?
> Is it a list or something that you have added attributes to? Or maybe a
> Your function pause.getKey() might look this no doubt?
> class pause:
> def getKey():
> Is that how it is? I'm just curious.
> Jacob Schmidt
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.
More information about the Tutor