I'm trying to build a program that will quiz me on vim commands.
As of now, the program works, but I have to press enter after entering the command. Such as:
move down (I press "j" then "enter")
move to top of screen (I press "e" then "enter")
move forward to end of word (I press "e" then "enter")
Is there a way to advance the program without having to hit enter?
I have the questions and answers in a csv file
Here's the program I have:
As of now, the program works, but I have to press enter after entering the command. Such as:
move down (I press "j" then "enter")
move to top of screen (I press "e" then "enter")
move forward to end of word (I press "e" then "enter")
Is there a way to advance the program without having to hit enter?
I have the questions and answers in a csv file
Here's the program I have:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
#! /usr/bin/python3 import csv from functions import clearScreen clearScreen() # clearing the screen studySet = input ( "Enter the set you would like to study: " ) with open (studySet) as f: # opening the csv file that contains the questions/answers fileContents = csv.reader(f) flashcards = {rows[ 0 ]:rows[ 1 ] for rows in fileContents} # storing the contents of the csv file into a dictionary questions = [] answers = [] for eachKey in flashcards.keys(): # this and next line storing the keys of dict in list called questions questions.append(eachKey) answers.append(flashcards[eachKey]) clearScreen() counter = 0 while counter < len (questions): yourAnswer = input (questions[counter] + "\n" ) if yourAnswer = = answers[counter]: clearScreen() elif yourAnswer ! = answers[counter]: clearScreen() print ( "Sorry. That was not correct." ) print ( "The correct answer is " + answers[counter]) questions.append(questions[counter]) answers.append(answers[counter]) counter + = 1 clearScreen() |