I built this project as a small, polished Python desktop application that generates a random programming joke at the click of a button. It’s intentionally simple in scope so the design, code clarity, and user experience are easy to evaluate quickly.
If you’re an employer/recruiter: this is a compact example of my ability to ship a working GUI app, integrate a third‑party dependency, and document my design and development decisions.
If you’re a developer: everything is straightforward and hackable—one file, minimal dependencies, and clear extension points.
- Type: Desktop GUI
- Language: Python
- UI framework: Tkinter
- Dependency:
pyjokes(joke source) - Entry point:
pythonjokegenerator.py
- Launches a small window titled “Python Joke Generator”.
- Displays a friendly starter prompt.
- On Generate Joke, fetches a random programming joke via
pyjokes.get_joke(). - Updates the UI in-place (no extra windows, no console interaction).
- Fast to run and review: one file, no framework overhead.
- Clean event-driven design: the UI reacts to a button click.
- Readable code over clever code: small functions, obvious naming.
- User-friendly presentation: centered text + wrapping to fit the window.
This project is intentionally a single-file application to keep the logic transparent.
-
Tk root window (
root)- Sets the title to
"Python Joke Generator". - Sets a fixed initial window size with
root.geometry("400x200").
- Sets the title to
-
Joke display (
joke_label)- Uses
wraplength=380so jokes don’t run off-screen. - Uses
justify="center"for an approachable, poster-style layout. - Starts with: “Click the button to generate a joke!”
- Uses
-
Action button (
generate_button)- Uses Tkinter’s
command=binding to connect the button click to application logic.
- Uses Tkinter’s
- The program creates the window and widgets.
root.mainloop()starts the Tkinter event loop.- When the user clicks Generate Joke, Tkinter invokes
generate_joke(). generate_joke()callspyjokes.get_joke()and updates the label viajoke_label.config(text=joke).
The “state” of the app is the currently displayed joke text in joke_label. For this scale, storing state directly in the widget keeps the implementation small and understandable.
I chose pyjokes because it provides a simple, deterministic API (get_joke) that’s perfect for demonstrating third-party integration without introducing a heavy web stack.
This version favors clarity and minimalism. If I expanded it, I would likely:
- Wrap the UI in a small
Appclass to avoid relying on module-level variables. - Add basic error handling (
try/except) around joke retrieval. - Add options like “joke category,” “copy to clipboard,” and “history.”
2026PythonJokes/
pythonjokegenerator.py
README.md
- Python 3.x
- Tkinter (typically included with Python on Windows/macOS)
pyjokes
Windows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install pyjokesmacOS / Linux:
python3 -m venv .venv
source .venv/bin/activate
pip install pyjokespython pythonjokegenerator.py- Low friction: one button, immediate feedback.
- Readable layout: centered text + wrapping tuned to the window width.
- Responsive UI: relies on Tkinter’s event loop (no blocking loops).
- Minimal surface area: one dependency and one file.
- Simple separation of concerns: UI widgets are created once; joke generation happens in
generate_joke().
- Tkinter is widely available.
- The app should run anywhere Python + Tkinter are available.
-
ModuleNotFoundError: No module named 'pyjokes'- Install it in the same environment you run:
pip install pyjokes.
- Install it in the same environment you run:
-
Tkinter missing (common on some Linux distros)
- Debian/Ubuntu:
sudo apt-get install python3-tk
- Debian/Ubuntu:
- Add joke category/language selection (if supported by the
pyjokesAPI). - Add Copy button (clipboard integration).
- Add history (keep last N jokes).
- Add keyboard shortcuts (e.g., Enter to generate).
- Add basic tests by isolating joke selection behind an interface and mocking the provider.
- Add packaging instructions (e.g., PyInstaller) for distributing an
.exe.
I’m [Your Name]. I’m building a portfolio of small, well-documented projects that demonstrate:
- practical Python skills,
- good engineering habits (clarity, simplicity, reproducibility), and
- a focus on user experience—even in small apps.
If you’d like, I can tailor this README to your specific role targets (e.g., junior SWE, automation, data, QA) and add a “Why this matters” section aligned to that job family.