-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathshell.py
More file actions
executable file
·28 lines (24 loc) · 909 Bytes
/
shell.py
File metadata and controls
executable file
·28 lines (24 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
import os
import sys
src_dir = os.path.abspath('src')
sys.path.insert(0, src_dir)
try:
# trigger monkeypatch in threadbare/__init__.py
# - https://github.com/elifesciences/threadbare/blob/ebf60da4fed5f57e0b231fdaa661b56d1d0a01b9/threadbare/__init__.py#L8
import threadbare # noqa: F401, I001
from importlib import reload # noqa: F401
from IPython.lib.deepreload import reload as dreload # noqa: F401
from IPython.terminal.embed import InteractiveShellEmbed # noqa: T100
print()
print("'importlib.reload' is available as 'reload'")
print("'IPython.lib.deepreload.reload' is available as 'dreload'")
print()
ipshell = InteractiveShellEmbed() # noqa: T100
ipshell()
except ImportError:
import code
print()
print("ipython not found, using regular shell")
print()
code.InteractiveConsole(locals=globals()).interact()