Skip to content

Commit

Permalink
Fisrt commit
Browse files Browse the repository at this point in the history
  • Loading branch information
grasph committed Jul 12, 2021
0 parents commit 9b563a4
Show file tree
Hide file tree
Showing 22 changed files with 7,560 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .ipynb_checkpoints/01 - Julia_from_IPython-checkpoint.ipynb
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
}
Loading

0 comments on commit 9b563a4

Please sign in to comment.