Python Prompts Free Prompt

Python Script to Monitor Open Ports on a Server

Write a Python script that scans open ports on a remote server
☆ Save
Prompt
You are a Python developer. Write a script that scans common ports on a given host to see if they are open. Use socket. The script must: 1) Accept hostname, 2) Scan a list of ports, 3) Report open/closed, 4) Timeout for slow ports, 5) Use threading for speed, 6) Save results, 7) Handle errors. Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.