i am trying to write a python script to get all the content in one file to be written to another file . but i am getting the below error . the code i am using is :
#!/user/bin/env python
with open('log.txt', 'r') as file:
line = file.read()
with open('/etc/snort/rules/test.rules' , 'w') as f2:
f2.write(line)
the error i get is :
in line 7
with open('/etc/snort/rules/test.rules' , 'w') as f2:
***IndentationError : expected an indented block***
f2.write(line)as well asline = file.read(). Indentation is usually 4 spaces per level of (Hint: if a line ends in a colon:, then at least one line underneath it needs to be indented).