WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-05-2024, 10:42 PM
anup.roy@iitgn. anup.roy@iitgn. is offline
Registered User
 
Join Date: May 2024
Posts: 1
EXE file is unable to update/create CSV file

Hi

We have developed Vizard based code (on Vizard 7), which creates and updates CSV file. On the Vizard IDE the code is working fine and is able to modify CSV.

However, when same code is exported as EXE using "Export as EXE" option on Vizard, it is unable to create/modify the CSV file.

We have checked permissions:
  1. The CSV file is not read-only.
  2. The User has Full Control (Read+Write+Execute) on Windows 10.
  3. The directory inside of which both EXE and CSV are present, is not read-only.


Below is the file handling code we are using. Please provide your valuable response.

Code:
try:
  # Save the demographic information to a CSV file (assuming "data" folder exists)
  with open('data/demographic_info.csv', 'a', newline='') as csvfile:
    fieldnames = ['name', 'age', 'gender', 'handedness']
    writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
    writer.writeheader()  # Write header if file is empty
    demographics['gender'] = ['Male', 'Female', 'Other'][demographics['gender'] - 1]
    demographics['handedness'] = ['Left Handed', 'Right Handed'][demographics['handedness'] - 1]
    writer.writerow(demographics)
    text = viz.addText3D(f"Success", parent=viz.SCREEN)
    # ... (rest of success message)
except Exception as e:
  print(f"Error writing to CSV: {e}")  # Print the specific error
  text = viz.addText3D(f"Error: Writing to CSV", parent=viz.SCREEN)
Reply With Quote
Reply

Tags
csv, exe, filehandling, vizard7


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fade in and fade out an audio file helena35 Vizard 5 05-30-2016 06:04 AM
Closing of an imported .py file Uttama_vizard Vizard 2 05-04-2010 06:18 AM
IVEx file extenstion unrecognised. sindi Vizard 2 12-10-2009 01:20 AM
Read file....many issues Uttama_vizard Vizard 9 07-08-2008 02:16 PM
File Management Uttama_vizard Vizard 2 07-01-2008 09:44 AM


All times are GMT -7. The time now is 04:40 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC