zoukankan      html  css  js  c++  java
  • 修改hosts文件的脚本1.0

    import sys


    IP_input = input("Please input IP:")
    DNS_input = input("Please input Domain-Name:")
    if sys.platform == 'win32':
    with open(r'C:WindowsSystem32driversetchost', 'a') as f:
    f.write(IP_input + ' '+DNS_input)
    elif sys.platform == 'linux' or sys.platform == 'darwin':
    with open('/etc/hosts', 'a') as f:
    f.write(IP_input + ' ' + DNS_input)
    else:
    pass
  • 相关阅读:
    PG
    unzip
    yum
    PG
    SQL
    Grails
    Grails
    Grails
    Chrome
    HTML
  • 原文地址:https://www.cnblogs.com/cuizhx/p/9795040.html
Copyright © 2011-2022 走看看