IIS connecting to Python through CGI

You must have Python already installed in your system.
Turns  windows features on off

Open Internet Information Services (IIS) Manager
In left panel go to default web site
Default IIS
At center panel check for Handler Mappings
Handler Mappings

At right panel check for Add Script Map
Add Script Map

Search for python.exe in your PC
Add Script Map
Enter the details as per the above picture. You can browse your PC and select the python.exe in your system.

Go to root of your localhost and create test.py file with this code
print("HTTP/1.0 200 OK\n")
print('Hello World')
Output
Hello World
You can import library
print("HTTP/1.0 200 OK\n")

import math 
print(math.pi)

Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com







Python Video Tutorials
Python SQLite Video Tutorials
Python MySQL Video Tutorials
Python Tkinter Video Tutorials
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer