Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tkf/ipython.jl
Run IPython inside Julia to exchange data interactively
https://github.com/tkf/ipython.jl
interactive ipython julia repl
Last synced: 17 days ago
JSON representation
Run IPython inside Julia to exchange data interactively
- Host: GitHub
- URL: https://github.com/tkf/ipython.jl
- Owner: tkf
- License: other
- Created: 2018-04-28T23:29:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-17T16:02:04.000Z (about 1 year ago)
- Last Synced: 2024-10-16T21:20:07.979Z (20 days ago)
- Topics: interactive, ipython, julia, repl
- Language: Python
- Homepage:
- Size: 163 KB
- Stars: 9
- Watchers: 3
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Launch IPython in Julia
[![Build Status][ci-img]][ci-url]
[![codecov.io][codecov-img]][codecov-url]![Example REPL session](example.png)
## Usage
Run `using IPython` and then type `.` in empty `julia>` prompt or run
`IPython.start_ipython()`. You can switch back to Julia REPL by
`backspace` or `ctrl-h` key (like other REPL modes). Re-entering
IPython keeps the previous state. Use pre-defined `Main` object to
access Julia namespace from IPython. Use `py"..."` string macro to
access Python namespace from Julia.**Note:**
First launch of IPython may be slow.## Requirements
### Julia
* PyCall
### Python
* Python 3.7 or above
* IPython 7.0 or above## Accessing Julia from Python
If simple `Main.eval("...")` and `Main.` accessor is not enough,
[PyJulia] is a nice way to access Julia objects from Python. For
example, you can import any Julia package from Python:[PyJulia]: https://github.com/JuliaPy/pyjulia
```pycon
>>> from julia import Base
>>> Base.banner()
```For more advanced/experimental Julia-(I)Python integration, see
[`ipyjulia_hacks`].[`ipyjulia_hacks`]: http://ipyjulia-hacks.readthedocs.io/en/latest
## Configuration
### Julia-mode like prompt
If you want IPython prompt to look like a part of Julia prompt, then add
the following snippet in `~/.ipython/profile_default/ipython_config.py`:```python
try:
from ipython_jl.tools import JuliaModePrompt
except ImportError:
pass
else:
c.TerminalInteractiveShell.prompts_class = JuliaModePrompt
```Then the prompt would then look like `ipy 1>` instead of `In [1]:`.
It also removes `Out[1]`. Note that above setting does not change
your normal IPython prompts.[ci-img]: https://github.com/tkf/IPython.jl/workflows/Run%20tests/badge.svg
[ci-url]: https://github.com/tkf/IPython.jl/actions?query=workflow%3ARun+tests
[codecov-img]: http://codecov.io/github/tkf/IPython.jl/coverage.svg?branch=master
[codecov-url]: http://codecov.io/github/tkf/IPython.jl?branch=master