Skip to content

Interactive Mode

Pre-release
Pre-release
Compare
Choose a tag to compare
@turkishmaid turkishmaid released this 06 Sep 15:43
· 8 commits to master since this release

Support usage of johanna enabled functions in interactive code, e.g. in Jupyter Notebooks.

Compare interactive test/icharlotte.py with background test/charlotte.py to see the difference.

import johanna
if __name__ == "__main__":
    johanna.main(None, dbname="hurz.sqlite")
    johanna.apply_schema("./schema.sql")
    with johanna.Connection("Charlotte") as c:
        c.cur.execute("insert or ignore into kvpairs(k, v) values (1, 'eins')")
        c.commit()
    johanna.flag_as_error()