Here anyway console based code even more clever is to use tkinter or other GUI and show/hide label.
from __future__ import print_function
from random import choice
input = raw_input
TIMEOUT = 0.4
things = 'kittens', 'puppies', 'stars'
response, this, tried, total = '', '', set(), 0
while len(tried) < len(things):
while not this or this in tried:
this = choice(things)
response = input('Write the word:')
if response == 'q':
correct = response == this
total += correct
print('You got it!' if correct else 'No, you did not get it correct')
if len(tried) == len(things):
print('You tried all words, and got right %i/%i' % (total, len(tried)))
Very inventive of you tonyjv. Here's my simplistic attempt :).
from time import sleep
print "\n" * 40
message = "read me soon because I'm bound to disappear"
sleep(1) # or .xx for milliseconds
#os.system("cls") #uncomment if running on windows from a command line
lotsofprints() #for use in idle maybe somebody cooler than me has better one
IDLE is OK for quick check but now and then you should run the program directly from command line or double click the file. Or you can use text editor that can run the file externally, not redirected like IDLE. We should maybe check IDLE's code and add possibility to launch file in external interpreter.
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.