tiffsea / python-code

Various python code snippets, tips, syntax, functions, etc.
4 stars 8 forks source link

Issue with running Convert_Json.py #2

Open jesmitty opened 6 months ago

jesmitty commented 6 months ago

I get the following error: Traceback (most recent call last): File "C:\data\USPTO\convert-json.py", line 50, in converter = Convert_Json(fn, title) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\data\USPTO\convert-json.py", line 10, in init self.mddata = self.format_json_to_md() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\data\USPTO\convert-json.py", line 25, in format_json_to_md for header, data in dct.items(): ^^^^^^^^^ AttributeError: 'list' object has no attribute 'items'

Is this a python version issue. I am running 3.12.1

tiffsea commented 5 hours ago

Hi @jesmitty, thanks for your comment. Can you tell me the data type of the file passed in fn parameter for Convert_Json() init? It seems instead of passing a json type you may have passed another data type like list. Let me know how it goes.