i am new to python and anyhow i managed to install Python on my Linux shared hosting. When I am trying to execute Python code in Shell terminal its working fine but i am not able to execute this code in browser directly and it just shows python code as text.
In Shell: python public_html/index.py
(Working)
But if i open same file in browser it doesnt execute code.
index.py
#!/usr/bin/env python
print("Content-Type: text/html\n")
print("Hello World")
I searched everywhere on internet but couldnt find answer, I also installed Django but same problem. please help me :(
I have not done any edit to .htaccess, if here i need any please tell me.
1 new line added in .bashrc
alias python='~/bin/python'
Also I am not sure how my shebang code must look like. Just i saw #!/usr/bin/env python
as commonly used SHEBANG code and used in my script.