当我调试代码时,会发生更改,但是当我打开文件时,没有任何改变。
代码
from ofxparse import OfxParser
from datetime import datetime as dt
# opening ofx file
with open('/home/jovani/Downloads/ofx.ofx') as file:
# Parser
ofx = OfxParser.parse(file)
#finding transactions
transactions = ofx.account.statement.transactions
now = dt.now() # I'll use this id like
for fitid in transactions: #performing changes and it happens
fitid_before = fitid.id
fitid_after = now.strftime("%Y%m%d%f")
fitid = fitid_after
此后,ofx.ofx文件中没有任何更改。
答案 0 :(得分:0)
您在问为什么文件没有更改。