Im inserting code snippets in my website using the <pre>
tag.
Here is the HTML/PHP code:
<pre class="prettyprint">
<?php include('canny.py'); ?>
</pre>
And here is the content of canny.py
:
import cv2
img = cv2.imread('/path/to/file/line_02.jpg', 0)
edges = cv2.Canny(img, 100, 200)
cv2.imwrite('mycanny.jpg', edges)
However, for some reason the first line renders like 3 or 4 tabs away from the left margin of the div element. And this only happens in the first line i.e, if i leave the first line of the .py file empty, the second line still renders fine.
Why is this happening, what is the way to make it work properly?