Skip to content

Commit 9b563a4

Browse files
committed
Fisrt commit
0 parents  commit 9b563a4

22 files changed

+7560
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "8b4b2ab7",
6+
"metadata": {},
7+
"source": [
8+
"Load the Julia magic extension"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": 3,
14+
"id": "4d4cbc68",
15+
"metadata": {},
16+
"outputs": [
17+
{
18+
"name": "stdout",
19+
"output_type": "stream",
20+
"text": [
21+
"The julia.magic extension is already loaded. To reload it, use:\n",
22+
" %reload_ext julia.magic\n"
23+
]
24+
}
25+
],
26+
"source": [
27+
"%load_ext julia.magic"
28+
]
29+
},
30+
{
31+
"cell_type": "markdown",
32+
"id": "f578aa1c",
33+
"metadata": {},
34+
"source": [
35+
"Excute some code written in ''Julia''"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": 12,
41+
"id": "6fdc193d",
42+
"metadata": {},
43+
"outputs": [
44+
{
45+
"name": "stdout",
46+
"output_type": "stream",
47+
"text": [
48+
"x = 10 ⇒ x² = 100\n"
49+
]
50+
}
51+
],
52+
"source": [
53+
"%%julia\n",
54+
"x = 10\n",
55+
"y = x^2\n",
56+
"println(\"x = $(x) ⇒ x² = $(y)\")"
57+
]
58+
},
59+
{
60+
"cell_type": "markdown",
61+
"id": "66b2da7a",
62+
"metadata": {},
63+
"source": [
64+
"Variables defined in Julia can be accessed from Python"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": 10,
70+
"id": "ae1c4b46",
71+
"metadata": {},
72+
"outputs": [
73+
{
74+
"name": "stdout",
75+
"output_type": "stream",
76+
"text": [
77+
"x = 10 ⇒ x² = 100\n"
78+
]
79+
}
80+
],
81+
"source": [
82+
"x = %julia x\n",
83+
"y = %julia y\n",
84+
"print(f'x = {x} ⇒ x² = {y}')"
85+
]
86+
}
87+
],
88+
"metadata": {
89+
"kernelspec": {
90+
"display_name": "Python 3",
91+
"language": "python",
92+
"name": "python3"
93+
},
94+
"language_info": {
95+
"codemirror_mode": {
96+
"name": "ipython",
97+
"version": 3
98+
},
99+
"file_extension": ".py",
100+
"mimetype": "text/x-python",
101+
"name": "python",
102+
"nbconvert_exporter": "python",
103+
"pygments_lexer": "ipython3",
104+
"version": "3.9.2"
105+
}
106+
},
107+
"nbformat": 4,
108+
"nbformat_minor": 5
109+
}

0 commit comments

Comments
 (0)