You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/workspace.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,12 @@ jupytext:
3
3
text_representation:
4
4
extension: .md
5
5
format_name: myst
6
+
format_version: 0.13
7
+
jupytext_version: 1.17.2
6
8
kernelspec:
7
-
display_name: Python 3
8
-
language: python
9
9
name: python3
10
+
display_name: Python 3 (ipykernel)
11
+
language: python
10
12
---
11
13
12
14
(workspace)=
@@ -51,7 +53,7 @@ Python files are used when writing long, reusable blocks of code - by convention
51
53
52
54
Let us begin by working with the following example.
53
55
54
-
```{code-block} python
56
+
```{code-cell} ipython3
55
57
:caption: sine_wave.py
56
58
:lineno-start: 1
57
59
@@ -68,17 +70,18 @@ plt.title('Sine Wave')
68
70
plt.show()
69
71
```
70
72
71
-
The code is first saved locally on the computer before it is executed.
72
-
73
73
As there are various ways to execute the code, we will explore them in the context of different development environments.
74
74
75
75
One major advantage of using Python scripts lies in the fact that you can "import" functionality from other scripts into your current script or Jupyter Notebook.
76
76
77
-
Let's rewrite the earlier code into a function.
77
+
Let's rewrite the earlier code into a function and write to to a file called `sine_wave.py`.
0 commit comments