python Hosts module install
pip install python-hosts
Hosts path setting
from python_hosts import Hosts, HostsEntry
hosts = Hosts(path='C:\\hosts3')
Hosts add
hosts.add([HostsEntry(entry_type='ipv4', address='1.2.3.4', names=['www.example.com', '#example'])])
hosts.write()
Hosts remove
hosts.remove_all_matching(address='1.2.3.4')
hosts.write()
Host cheack
hosts.exists(address='1.2.3.4')
'IT > Python' 카테고리의 다른 글
| Python Jenkins Module Install (0) | 2021.01.13 |
|---|---|
| Python E-Mail Send (0) | 2021.01.13 |
| Python Slack Msg Send (0) | 2021.01.13 |
| python rundeck module install (0) | 2021.01.13 |
| Python Jira Module Install (0) | 2021.01.13 |