要处理的文件
from base64 import b64decode
from base64 import b64encode
import pandas as pd
# 测试
a = b64decode("NDM0OTcxOA==").decode("ascii")
print(a)
b = bytes(a, encoding="ascii")
print(b64encode(b).decode("ascii"))
###
tmpdf = pd.read_excel('D:\codecode\gameid.xlsx')
#print(tmpdf)
# 循环解码,结果写入文件
tmpdf["id"] = ['%s' % b64decode(i).decode("ascii") for i in tmpdf["third_id"]]
print(tmpdf)
tmpdf.to_excel('D:\codecode\gameid2.xlsx')
print("OK")
处理结果: