当我调试我的代码时,会发生变化,但是当我打开文件时,什么都没有改变。
代码
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 文件中没有任何变化。