Sriram S.

asked • 03/03/19

How to call python from python + html code?

Friends, I have a python program which runs html program to create box as follows which runs on wamp server:


**box.py:**


#!C:/python27/python.exe -u

print "Content-type: text/html\n"

print('''\

<html>

<head>

<title>FACE</title>

<style>

div {

width: 500px;

height: 450px;

border: 15px solid blue;

padding: 25px;

margin: 70px;

}

h1{

color:red;

font-size: 1.875em;

font-family: "Times New Roman";

}

</style>

</head>

<body bgcolor="lightblue">

<center><h1>PLEASE SHOW US YOUR FACE</h1></center>

<center><div>


how are you?


</div></center>

</body>

</html>

''')


This creates box when running using localhost/cgi-bin/box.py.

But I also have "just cam.py" program which reads webcam which code is as follows,

**just cam.py:**


import cv2

import numpy as np

cap = cv2.VideoCapture(0)

while True:

_, frame= cap.read()

gray = cv2.cvtColor(frame , cv2.COLOR_BGR2GRAY)

cv2.imshow('Face', frame)

k=cv2.waitKey(1)


if k == 27:

break


cv2.destroyAllWindows()

cap.release()

How to run the above mentioned "just cam.py" inside box created in "box.py"? Please help me friends

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.