My Problem...
I recently read the wonderful book the-programmers-brain. One take-away was that if you study concepts with flash cards it will help learn new stuff more efficiently. So i was looking for a while now how to do that using my android phone.
I'm a pretty heavy obsidian user and had a look at the plugins i knew of but was not really satisfied and looked and some apps. This didn't really worked easly or made me jump through more hoops than i wanted to.
I'm no Android Developer yet and not really a web dev either. I want to use flash cards to learn angular and typescript, so my options were a litte limited. Here is what i came up with:
My Solution...
There is a fantastic app called termux on android which gives you a complete linux environment.
termux
In termux you are able to work with python and git. So i came up with a small python project containing of one python script and a markdown file at the moment.
The python file uses the rich library because i can render markdown pretty to the cli (with syntax highlighting).
from rich.console import Console from rich.markdown import Markdown def main(): console = Console() with open("angular.md") as f: content: str = f.read() cards: list[str] = content.split('<!-- Card -->') numberOfCards: int = len(cards) for card in cards: console.clear() sides = card.split('<!-- Sides -->') console.print(Markdown(sides[0])) input("\nshow the answer!") console.print(Markdown(sides[1])) input("\nnext card!") console.clear() if __name__ == "__main__": main()
The content of my flashcards is stored in a markdown file. I use html comments to seperate the individual cards and the question and the answer on each individual card.
I have this all on a little github project. github. (The name of the project will change.) S
On my phone i have to clone the repo in termux:
git clone https://github.com/taijidude/mochi-cards.git
Install the needed dependencies (typer is a neat cli framework which brings the rich library as dependency. I use typer here because i want to do more with it in the future. )
pip install typer
and than can run the app:
python app.py
Finally i get a basic flashcard functionality with syntax highlighting.
After starting:
When hitting enter the answer is shown:
When hitting enter again i get the next question:
Thank you for your Attention!
The above is the detailed content of Small prototype... easy coding flash cards on android. For more information, please follow other related articles on the PHP Chinese website!

TomergelistsinPython,youcanusethe operator,extendmethod,listcomprehension,oritertools.chain,eachwithspecificadvantages:1)The operatorissimplebutlessefficientforlargelists;2)extendismemory-efficientbutmodifiestheoriginallist;3)listcomprehensionoffersf

In Python 3, two lists can be connected through a variety of methods: 1) Use operator, which is suitable for small lists, but is inefficient for large lists; 2) Use extend method, which is suitable for large lists, with high memory efficiency, but will modify the original list; 3) Use * operator, which is suitable for merging multiple lists, without modifying the original list; 4) Use itertools.chain, which is suitable for large data sets, with high memory efficiency.

Using the join() method is the most efficient way to connect strings from lists in Python. 1) Use the join() method to be efficient and easy to read. 2) The cycle uses operators inefficiently for large lists. 3) The combination of list comprehension and join() is suitable for scenarios that require conversion. 4) The reduce() method is suitable for other types of reductions, but is inefficient for string concatenation. The complete sentence ends.

PythonexecutionistheprocessoftransformingPythoncodeintoexecutableinstructions.1)Theinterpreterreadsthecode,convertingitintobytecode,whichthePythonVirtualMachine(PVM)executes.2)TheGlobalInterpreterLock(GIL)managesthreadexecution,potentiallylimitingmul

Key features of Python include: 1. The syntax is concise and easy to understand, suitable for beginners; 2. Dynamic type system, improving development speed; 3. Rich standard library, supporting multiple tasks; 4. Strong community and ecosystem, providing extensive support; 5. Interpretation, suitable for scripting and rapid prototyping; 6. Multi-paradigm support, suitable for various programming styles.

Python is an interpreted language, but it also includes the compilation process. 1) Python code is first compiled into bytecode. 2) Bytecode is interpreted and executed by Python virtual machine. 3) This hybrid mechanism makes Python both flexible and efficient, but not as fast as a fully compiled language.

Useaforloopwheniteratingoverasequenceorforaspecificnumberoftimes;useawhileloopwhencontinuinguntilaconditionismet.Forloopsareidealforknownsequences,whilewhileloopssuitsituationswithundeterminediterations.

Pythonloopscanleadtoerrorslikeinfiniteloops,modifyinglistsduringiteration,off-by-oneerrors,zero-indexingissues,andnestedloopinefficiencies.Toavoidthese:1)Use'i


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Notepad++7.3.1
Easy-to-use and free code editor

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
