Skip to content

literate computing - interactive literate programming¤

literate computing relies on a rapid feedback from the computer. pidgy features multiple reactive/interactive displays for presenting your content. we'll explore the displays and meaning with two demos: 1. the cookies demo 2. the dataframe demo

cookies demo¤

the cookies demo is mainstay in the deathbeds repertoire. inspired by bret viktors tanglejs we explore the cookie demo in pidgy.

HTML(value='<pre><code>%reload_ext pidgy\nimport pidgy\nshell.displays_manager.template_cls = pidgy.weave.IPyW…
HTML(value='<pre><code>cookies = IntSlider(3)</code></pre>\n')
HTML(value='<style>\n#hunger {\n    opacity: 0.15;\n    font-size: 0.15rem;\n    background-image: url("https:…
HTML(value='<div id="hunger">cookies!\ncookies!\ncookies!\n</div>')
HTML(value='<p>if i eat 3 then i consume 150 calories.</p>\n<pre><code>shell.displays_manager.template_cls = p…

if i eat 3 then i consume 150 calories.

shell.displays_manager.template_cls = pidgy.weave.IPythonHtml

if i eat 3 then i consume 150 calories.

shell.displays_manager.template_cls = pidgy.weave.IPythonMarkdown
IntSlider(value=3)
cookies

Dataframes¤

from ipywidgets import interact_manual
import pandas
who = Text("tonyfast")
HTML(value='<pre><code>shell.displays_manager.template_cls = pidgy.weave.IPyWidgetsHtml\n</code></pre>\n<p><co…
shell.displays_manager.template_cls = pidgy.weave.IPythonHtml

g is undefined

shell.displays_manager.template_cls = pidgy.weave.IPythonMarkdown

g is undefined

g = df.iloc[:5, :5]
interactive(children=(Text(value='tonyfast', description='who'), Button(description='Run Interact', style=Butt…
<function __main__.update(who)>
def update(who):
    global df, g
    g = df = pandas.read_json(F"https://api.github.com/users/{who}/gists")
interact_manual(update, who=who)