Skip to content

Commit f6fd84a

Browse files
committed
Clarify the REPL used [ci skip]
1 parent 1a0b1bd commit f6fd84a

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ GNU/Linux distributions.
2020
You will need to install PyCall in your existing Julia installation
2121

2222
```julia
23-
using Pkg # for julia ≥ 0.7
24-
Pkg.add("PyCall")
23+
julia> using Pkg # for julia ≥ 0.7
24+
julia> Pkg.add("PyCall")
2525
```
2626

2727
Your python installation must be able to call Julia. If your installer
@@ -36,32 +36,32 @@ with the following installation steps, we recommend to have a look at
3636

3737
To get released versions you can use:
3838

39-
```sh
40-
python3 -m pip install --user julia
41-
python2 -m pip install --user julia # If you need Python 2
39+
```console
40+
$ python3 -m pip install --user julia
41+
$ python2 -m pip install --user julia # If you need Python 2
4242
```
4343

4444
where `--user` should be omitted if you are using virtual environment
4545
(`virtualenv`, `venv`, `conda`, etc.).
4646

4747
If you are interested in using the development version:
4848

49-
```sh
50-
python3 -m pip install --user 'https://github.com/JuliaPy/pyjulia/archive/master.zip#egg=julia'
49+
```console
50+
$ python3 -m pip install --user 'https://github.com/JuliaPy/pyjulia/archive/master.zip#egg=julia'
5151
```
5252

5353
You may clone it directly to your home directory.
5454

55-
```
56-
git clone https://github.com/JuliaPy/pyjulia
55+
```console
56+
$ git clone https://github.com/JuliaPy/pyjulia
5757
```
5858

5959
then inside the pyjulia directory you need to run the python setup file
6060

61-
```
62-
cd pyjulia
63-
python3 -m pip install --user .
64-
python3 -m pip install --user -e . # If you want "development install"
61+
```console
62+
$ cd pyjulia
63+
$ python3 -m pip install --user .
64+
$ python3 -m pip install --user -e . # If you want "development install"
6565
```
6666

6767
The `-e` flag makes a development install, meaning that any change to pyjulia
@@ -82,42 +82,42 @@ which can be used in a customized setup.
8282
To call a Julia function in a Julia module, import the Julia module
8383
(say `Base`) with:
8484

85-
```python
86-
from julia import Base
85+
```pycon
86+
>>> from julia import Base
8787
```
8888

8989
and then call Julia functions in `Base` from python, e.g.,
9090

91-
```python
92-
Base.sind(90)
91+
```pycon
92+
>>> Base.sind(90)
9393
```
9494

9595
Other variants of Python import syntax also work:
9696

97-
```python
98-
import julia.Base
99-
from julia.Base import LinAlg # import a submodule
100-
from julia.Base import sin # import a function from a module
97+
```pycon
98+
>>> import julia.Base
99+
>>> from julia.Base import LinAlg # import a submodule
100+
>>> from julia.Base import sin # import a function from a module
101101
```
102102

103103
The global namespace of Julia's interpreter can be accessed via a
104104
special module `julia.Main`:
105105

106-
```python
107-
from julia import Main
106+
```pycon
107+
>>> from julia import Main
108108
```
109109

110110
You can set names in this module to send Python values to Julia:
111111

112-
```python
113-
Main.xs = [1, 2, 3]
112+
```pycon
113+
>>> Main.xs = [1, 2, 3]
114114
```
115115

116116
which allows it to be accessed directly from Julia code, e.g., it can
117117
be evaluated at Julia side using Julia syntax:
118118

119-
```python
120-
Main.eval("sin.(xs)")
119+
```pycon
120+
>>> Main.eval("sin.(xs)")
121121
```
122122

123123
### Low-level interface
@@ -126,15 +126,15 @@ If you need a custom setup for `pyjulia`, it must be done *before*
126126
importing any Julia modules. For example, to use the Julia
127127
executable named `custom_julia`, run:
128128

129-
```python
130-
from julia import Julia
131-
jl = julia.Julia(runtime="custom_julia")
129+
```pycon
130+
>>> from julia import Julia
131+
>>> jl = julia.Julia(runtime="custom_julia")
132132
```
133133

134134
You can then use, e.g.,
135135

136-
```python
137-
from julia import Base
136+
```pycon
137+
>>> from julia import Base
138138
```
139139

140140

0 commit comments

Comments
 (0)