Download test.py from pengyuyan1222/instock_warning_GUI_cloud: direct link, hf CLI and curl.
- Browser
- Download file 243 Bytes
-
https://huggingface.co/spaces/pengyuyan1222/instock_warning_GUI_cloud/resolve/main/test.py
- Command line
-
hf download hf://spaces/pengyuyan1222/instock_warning_GUI_cloud/test.py
-
curl -L -o test.py https://huggingface.co/spaces/pengyuyan1222/instock_warning_GUI_cloud/resolve/main/test.py
243 Bytes
| import socket | |
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| result = sock.connect_ex(("rm-wz9dh38emx9o7w0jnmo.mysql.rds.aliyuncs.com", 3306)) | |
| if result == 0: | |
| print("Port is open") | |
| else: | |
| print("Port is closed or unreachable") |