A simple Flask server that displays a unicode playing card. I made this as part of a little card trick for a friend's birthday.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Michael Zeevi 54aab9dc9f
fadein only for non default cards
6 months ago
templates fadein only for non default cards 6 months ago
README.md added reset_card route 6 months ago
app.py fadein only for non default cards 6 months ago
dockerfile app written and dockerized 7 months ago
makefile renamed docker image to match repo 7 months ago
requirements.txt set flask version 6 months ago

README.md

Flask card trick

Background

I used this as part of a little card trick for a friend's birthday.

About

This is a simple Flask server that displays a unicode playing card (see table below) which can be preset or updated. The default card is a card back (🂠).

Usage

  1. Requesting the route / will display the current card (default is a blank card back).

  2. The card can be set by requesting the route /u<new_card> (u is short for update), where new_card is a case-insensitive card name consisting of an index and suit (see table below).

    Example values: 3c (for 3 of Clubs), 10d (for 10 of Diamonds) or as (for Ace of Spades).

  3. The 2nd step can be repeated as many times as desired.

  4. Requesting the route /r will reset to the blank card back.

Unicode cards

new_card a (Ace) 2 3 4 5 6 7 8 9 10 or 0 j (Jack) q (Queen) k (King)
s (Spades) 🂡 🂢 🂣 🂤 🂥 🂦 🂧 🂨 🂩 🂪 🂫 🂭 🂮
h (Hearts) 🂱 🂲 🂳 🂴 🂵 🂶 🂷 🂸 🂹 🂺 🂻 🂽 🂾
d (Diamonds) 🃁 🃂 🃃 🃄 🃅 🃆 🃇 🃈 🃉 🃊 🃋 🃍 🃎
c (Clubs) 🃑 🃒 🃓 🃔 🃕 🃖 🃗 🃘 🃙 🃚 🃛 🃝 🃞