I have an index.py file which has to call another file which has python code whose RESULT should be displayed on the browser.
The link which I am calling is: "localhost/python/index.py?v=check" where index is the file containing the following code:
#!F:/Python/python.exe
import cgi, cgitb, os
print ("Content-Type: text/html; charset=utf-8")
print("")
cgitb.enable()
form = cgi.FieldStorage()
fileitem = form["v"]
If I am using :
print(fileitem)
then the output is displayed as check which is the value of variable v. I want the output to be the output of a file called check.py saved in the same directory as index.py
This is the code of check.py:
print("Just a check")
It has just a single line to print "Just a check"
I expect the output to be : Just a check. Is there any way to achieve this?