在with open或者定义函数时均报错
with open('data.txt', 'w') as f: f.write('hello world') #文件的写操作 def func(): print("a")
File "", line 2
^
IndentationError: expected an indented block after 'with' statement on line 1
你这个是缩进错误 with那里的缩进有问题