Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
LEAP_PROJECT-/Os_addr_info.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37 lines (19 sloc)
808 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import subprocess | |
import os | |
import platform | |
'''these are the three information need to be provide to enter the system''' | |
print("1. provide address information") | |
print("2 . provide the system information") | |
print("3 . provide OS name") | |
i = int(input("please select one choice ")) | |
'''used if statement make 1,2, or 3 decisions or will give an error''' | |
if i == 1: ### list of choices | |
addr = str(input("give the address please >> "))###frist choice | |
print(socket.getaddrinfo(addr,80, proto=socket.IPPROTO_TCP)) | |
elif i == 2: | |
print(platform.platform())###second choice | |
elif i == 3: | |
print(os.name)###third choice | |
else: | |
print("error please select one of the three choices 1,2,or 3")###if there is an error will dispaly this msg | |