@@ -20,8 +20,8 @@ GNU/Linux distributions.
2020You 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
2727Your 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
3737To 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
4444where ` --user ` should be omitted if you are using virtual environment
4545(` virtualenv ` , ` venv ` , ` conda ` , etc.).
4646
4747If 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
5353You 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
5959then 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
6767The ` -e ` flag makes a development install, meaning that any change to pyjulia
@@ -82,42 +82,42 @@ which can be used in a customized setup.
8282To 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
8989and 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
9595Other 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
103103The global namespace of Julia's interpreter can be accessed via a
104104special module ` julia.Main ` :
105105
106- ``` python
107- from julia import Main
106+ ``` pycon
107+ >>> from julia import Main
108108```
109109
110110You 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
116116which allows it to be accessed directly from Julia code, e.g., it can
117117be 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*
126126importing any Julia modules. For example, to use the Julia
127127executable 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
134134You 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