A great TUI study tool
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-20 19:19:10 -04:00
flashsets Flashcards complete 2026-09-20 12:30:57 -04:00
config.txt Flashcards complete 2026-09-20 12:30:57 -04:00
flashcards.py Flashcards complete 2026-09-20 12:30:57 -04:00
README.md Add README 2026-09-20 19:19:10 -04:00
task.txt Flashcards complete 2026-09-20 12:30:57 -04:00

PFlashcards

A small, keyboard-driven flashcards program that runs in your terminal. Built on the Python standard library's curses module, with zero external dependencies.

Everything is a file: flashcard sets are plain-text .txt files, and configuration is a plain-text config.txt.

Features

  • Flashcard sets stored as easy-to-edit plain-text files in flashsets/
  • Animated card flip (horizontal or vertical) when you answer
  • Number-key answer selection
  • Sequential or shuffled study order
  • Live progress and correct/wrong statistics
  • End-of-session summary with restart option
  • Set selection screen when no file is given
  • Resize and small-terminal safe, restores your terminal on exit

Requirements

  • Python 3 (uses only the standard library, including curses)
  • A normal terminal (works over SSH)

Usage

Run the program with one of your flashcard sets:

python3 flashcards.py flashsets/python.txt
python3 flashcards.py --shuffle flashsets/linux.txt

Run it with no arguments to pick a set from a selection screen:

python3 flashcards.py

Controls

Key Action
1-9 Select an answer
N/Enter Next card
B Previous card
R Retry the current card
S Shuffle the card order
Q Quit

Flashcard format

Each card is a numbered block with a question, two or more numbered answers, the correct answer number, and an optional explanation:

1 {
    question: "What is the capital of France?"
    answers: {
        "1: London"
        "2: Paris"
        "3: Berlin"
        "4: Madrid"
    }
    correct: 2
    explanation: "Paris has been the French capital since the 12th century."
}

Blank lines and lines starting with # are ignored. Escape sequences allowed inside quoted fields: \n, \t, \", \\.

Files are ordinary text, so they work with the usual Unix tools:

cat flashsets/python.txt
grep "chmod" flashsets/linux.txt
cp flashsets/linux.txt flashsets/linux-backup.txt
nvim flashsets/python.txt

Configuration

Behaviour can be tweaked in config.txt next to the program. Currently it controls the flip animation:

animation: horizontal   # card narrows to a vertical line, then widens again
animation: vertical     # card shortens to a horizontal line, then grows again

Uncomment exactly one animation line. If none or more than one is set, the program falls back to horizontal.