简体   繁体   中英

Using %pwd in markdown (jupyter notebook) to import images from directory

I am writing in a markdown cell on Jupyter Notebook. I am using the following code to look in the directory that the current notebook is being loaded from and show the image "img.png". This code works. I just wanted to know if there was a way to make the "%pwd" 'invisible' upon running the cell, as it obviously is not meant to be showing in the passage I am writing.

%pwd
<img src="img.png" alt="Electrical network" width=1000>

Thanks.

You dont need to use %pwd

You can simply use <img src="img.png" alt="Python" style="width: 400px;"/> to load images

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM