Properly using the Multiline Cursor will greatly save your time and efficiently improves your work
This post will introduce you to the multiline cursor of Jupyter notebook, and illustrates you where we can use it and how handy it is with some specific examples.
1. How to make the Multiline Cursor
One can use combination of Alt/Option
key and mouse
to easily make the Multiline Cursor in a Jupyter notebook.
(1) Place mouse cursor in the desired spot.
(2) Press Alt
key on the keyboard or Option
key on Macbook
(3) Hold the left mouse button
and drag mouse
over the multi-lines where you want the cursor.
2. Where it can be used
It is very handy for multiline operations, including but not limited to the following aspects:
- Comments
- Indentation
- Bullets
- Emphasized text
- Text Alignment
- Make Tables
- Multiple Plots
- Multiple String Items
Let’s take some examples to see how to use it with three concrete examples in the next section.
3. Examples
(1) Multiline comments
We want to comment multilines on our code snippet like the following example.
print("Hello")
print("hi")print(20)
print("Hello1")
#print("hi2")
#print(20)
#print("Hello1")
#print("hi2")
#print(23)
The working process looks as follows:
(2) Multiline indentation
For example, we want to indent the following lines.
Comments
Indentation
Bullets
Emphasized text
Text Alignment
Make Tables
Multiple Plots
Multiple String Items
The output is:
3. Bullets
In this example, let’s bullet multi-lines as follows:
- Comments
- Indentation
- Bullets
- Emphasized text
- Text Alignment
- Make Tables
- Multiple Plots
- Multiple String Items
The working process:
4. Video Tutorial
If you want to see more examples, you are welcome to watch the video tutorial on my YouTube channel. If this video is helpful, please subscribe to my channel to support me.
5. Online Course
If you are interested in learning Jupyter notebook in details, you are welcome to enroll one of my course Practical Jupyter Notebook from Beginner to Expert.