2

I'm new to Julia, I have a file called "example.jl" and I want to open it in Jupyter. I added the Julia kernel to my jupyter kernels. My question is: Is there a terminal command like:

jupyter notebook blabla.ipynb [that I use to open my notebooks]

Which opens my "example.jl" script in my jupyter notebook with the right jl kernel?

I looked into many pages and couldn't find an answer.

P.S: What I do now is to open a notebook with jl kernel and copy the Julia script into it. But I'd like to know if there are more elegant ways to open .jl s.

1 Answer 1

2

Generally you need to create a new empty Jupyter notebook with Julia kernel and copy-paste your code there.

There is also a nice Julia implementation - Weave.jl. Since Jupyter's format is more complex, special code formatting is required (for hints see pictures at https://github.com/JunoLab/Weave.jl) - once it is done you can do the conversion in the following way:

convert_doc("examples/some_code.jl", "some_notebook.ipynb") 

There are some other (usually Python-based) tools available, that under some circumstances can be used to split source code file into several Jupyter cells but again every time this assumes some specific code formatting.

P.S. If you are looking for and IDE try Visual Studio Code with Julia extension which is great.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.