Est-il possible d'utiliser le shell IPython d'un shell Python existant, comme shell-inside-a-shell, de la même manière que le code.interact()
intégré?Utiliser IPython à partir du shell Python comme `code.interact()`
15
A
Répondre
3
Le recommended way d'intégration IPython fonctionne très bien:
~ $ python
Python 2.7 [...]
>>> from IPython.Shell import IPShellEmbed
>>> ipshell = IPShellEmbed()
>>> ipshell()
In [1]:
1
Django manage.py shell
invoquez une coquille IPython lorsque cela est possible, et il est mis en œuvre comme ceci:
import IPython
shell = IPython.Shell.IPShell()
shell.mainloop()
19
En IPython 0,11 l'API a été révisé et la coquille est encore plus facile à invoquer:
import IPython
IPython.embed()