Python Forum
Invalid Identifier In Long Text File
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid Identifier In Long Text File
#1
I am currently doing a project that requires storing a lot of data, in the form of a list of dictionaries. Currently, I do this by writing it to a text file, and then using exec on the string we get from reading the file.

Unfortunately, I cannot get anything from one of the files. I can extract it as a string, but when I call exec on it, I get the following error:

SyntaxError: invalid character in identifier

I assume there's just a bad character somewhere in the file, but I'm not sure. Is there some automated tool for finding invalid characters in text files?
Reply


Messages In This Thread
Invalid Identifier In Long Text File - by asilverg - Jan-25-2019, 11:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Decoding lat/long in file name johnmcd 4 449 Mar-22-2024, 11:51 AM
Last Post: johnmcd
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,175 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  Modify values in XML file by data from text file (without parsing) Paqqno 2 1,762 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  Converted Pipe Delimited text file to CSV file atomxkai 4 7,125 Feb-11-2022, 12:38 AM
Last Post: atomxkai
  [split] How to convert the CSV text file into a txt file Pinto94 5 3,446 Dec-23-2020, 08:04 AM
Last Post: ndc85430
  Saving text file with a click: valueerror i/o operation on closed file vizier87 5 4,509 Nov-16-2020, 07:56 AM
Last Post: Gribouillis
  Graph identifier samuelbachorik 4 2,720 Oct-04-2020, 01:25 PM
Last Post: scidam
  saving data from text file to CSV file in python having delimiter as space K11 1 2,443 Sep-11-2020, 06:28 AM
Last Post: bowlofred
  Web Form to Python Script to Text File to zip file to web wfsteadman 1 2,181 Aug-09-2020, 02:12 PM
Last Post: snippsat
  Convert Excel file to Text file marvel_plato 6 19,993 Jul-17-2020, 01:45 PM
Last Post: marvel_plato

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020