gpt4 book ai didi

python - 如何读取gzip : 'GzipFile' object has no attribute 'extrastart' '

转载 作者:行者123 更新时间:2023-12-01 04:39:20 24 4
gpt4 key购买 nike

我想阅读gzip并更新内容。

但是,我收到错误

'AttributeError: 'GzipFile' object has no attribute 'extrastart''.

import gzip                                                 

with gzip.open("PhoneWindowManager.java.gz", "w+") as file:
for line in file:
if "setHdmiPlugged" in line:
call = "#setHdmiPlugged"
if call in line:
continue
else:
print line
break

最佳答案

extrastart 仅在模式以“r”开头时设置,

with gzip.open("PhoneWindowManager.java.gz", "r") as file://change "w+" to "r+" 

关于python - 如何读取gzip : 'GzipFile' object has no attribute 'extrastart' ',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31108274/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com