Hello I am new to python and I wanted to know how I can load an image from a directory on the computer in a html page using python?
Asked
Active
Viewed 412 times
1 Answers
0
Can you add more details to your question, please? It is unclear what is the aim here.

Syed Muhammad Dawoud Sheraz
- 217
- 3
- 7
-
I have a .png file in my D:\ drive. I want to load the image in a html page using python. – Rutuparna Dec 28 '21 at 07:22
-
For clarity, are you running a Python socket-based server to serve HTML files? Or will the code generate an HTML file provided an image file path? The approach will be different for each case. If the code is generating an HTML file, you will need to embed the image inside HTML. Please see https://stackoverflow.com/questions/7389567/output-images-to-html-using-python, related to your question. – Syed Muhammad Dawoud Sheraz Dec 28 '21 at 07:27