这个错误通常是因为文件或模块的名称与Python内置模块或库的名称发生冲突。要解决这个问题,可以尝试更改文件或模块的名称,以避免与内置模块或库发生冲突。\n\n例如,将文件名从"base64.py"更改为其他名称,然后再次运行代码。\n\n# 打开输入文件和输出文件\nwith open('jiami.txt', 'r') as inputFile, open('jiemi.txt', 'w') as outputFile:\n # 逐行读取输入文件\n for line in inputFile:\n # 分割每行数据\n columns = line.strip().split('\t')\n # 解码第二列数据\n decodedData = base64.b64decode(columns[1]).decode('utf-8')\n # 写入输出文件\n outputFile.write(f"{columns[0]}\t{decodedData}\n")报错 decodedData = base64.b64decode(columns[1]).decode('utf-8')\nAttributeError: partially initialized module 'base64' has no attribute 'b64decode' (most likely due to a circular import)

Python 解码 Base64 数据:修复

原文地址: https://www.cveoy.top/t/topic/qcBg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录