Using python, I am trying to edit the hosts file.
with open('C:\Windows\System32\drivers\etc\hosts', 'r+') as file:
data = file.readlines()
data[70] = '127.0.0.1 web.alanmrsa.com'
file.writelines(data)
print('done')
When I run this file, it gives me the following error:
PermissionError: [Errno 13] in python