-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9b563a4
Showing
22 changed files
with
7,560 additions
and
0 deletions.
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
.ipynb_checkpoints/01 - Julia_from_IPython-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "8b4b2ab7", | ||
"metadata": {}, | ||
"source": [ | ||
"Load the Julia magic extension" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "4d4cbc68", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"The julia.magic extension is already loaded. To reload it, use:\n", | ||
" %reload_ext julia.magic\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"%load_ext julia.magic" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "f578aa1c", | ||
"metadata": {}, | ||
"source": [ | ||
"Excute some code written in ''Julia''" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"id": "6fdc193d", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"x = 10 ⇒ x² = 100\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"%%julia\n", | ||
"x = 10\n", | ||
"y = x^2\n", | ||
"println(\"x = $(x) ⇒ x² = $(y)\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "66b2da7a", | ||
"metadata": {}, | ||
"source": [ | ||
"Variables defined in Julia can be accessed from Python" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"id": "ae1c4b46", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"x = 10 ⇒ x² = 100\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"x = %julia x\n", | ||
"y = %julia y\n", | ||
"print(f'x = {x} ⇒ x² = {y}')" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.