【文件属性】:
文件名称:My-little-program
文件大小:47.74MB
文件格式:ZIP
更新时间:2021-05-12 18:50:02
Python
我的小程序
基于我自己编写的一些程序基于Easy Programming Language或Python。
import requests
url = 'https://coding.net/u/scaffrey/p/hosts/git/raw/master/hosts'
try :
r = requests . get ( url )
hosts = r . text
except :
print ( "I can't get the hosts. Can you give me another hosts url?" )
try :
with open ( '/etc/hosts' , 'w' ) as f :
f . write ( hosts )
except :
print ( "I can't write the hos