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:
- The CSV file is not read-only.
- The User has Full Control (Read+Write+Execute) on Windows 10.
- 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)