Skip to content

Instantly share code, notes, and snippets.

@piotrkilczuk
Created June 4, 2021 11:33
Show Gist options
  • Save piotrkilczuk/6ed797e6bf983606ade0ab0bc817bf84 to your computer and use it in GitHub Desktop.
Save piotrkilczuk/6ed797e6bf983606ade0ab0bc817bf84 to your computer and use it in GitHub Desktop.
pythonstartup_exec_2.bash
$ PYTHONSTARTUP=./_pythonstartup.py ipython
Python 3.9.0 (default, Nov 19 2020, 14:06:03)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.24.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: session
Out[1]: <sqlalchemy.orm.session.Session at 0x7f1efed0ee50>
In [2]: session.execute("SELECT * FROM users").fetchall()
Out[2]: [(1, 'johndoe', 'somehash')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment