1 year ago

#74186

test-img

Spiridon

Csv file does not get updated after using pyinstaller

I am using a csv file in a personal project. This is the code snippet which saves to the csv file:

def register_item():
    new_entry = [id,radioType.get(),article_entry.get(),radioStyle.get(),color_entry.get(),material_entry.get(),aesthetic_entry.get(),radioRain.get(),radioWind.get(),radioCold.get()]
    print(new_entry)
    with open(os.path.dirname(__file__) + 'Clothes_database.csv','a',newline='') as csv_file:
        writer_obj = writer(csv_file)
        writer_obj.writerow(new_entry)
        csv_file.close()

After using pyinstaller -F clothes_itemizer.py the csv file does not get updated anymore. Here is the .spec file generated alongside it

# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(['clothes_itemizer.py'],
             pathex=[],
             binaries=[],
             datas=[],
             hiddenimports=[],
             hookspath=[],
             hooksconfig={},
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)

exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,  
          [],
          name='clothes_itemizer',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          upx_exclude=[],
          runtime_tmpdir=None,
          console=True,
          disable_windowed_traceback=False,
          target_arch=None,
          codesign_identity=None,
          entitlements_file=None )

python

csv

pyinstaller

0 Answers

Your Answer

Accepted video resources