[Tutor] Converting a txt file to dictionary

nzbz xx nzbzxx at gmail.com
Wed Aug 26 08:01:24 EDT 2020


I have a plantrecords.txt file with the following format:

Plantname
date & time of record
description
description
description
(blank line)
Plantname
date & time of record
description
description
description
(blank line)
.
.
.


How do I  convert this text file into a dictionary such that it gives me
dict = {'plantname': [datetimerecord, description, description,
description], 'plantname': [datetime.....]} so on and so forth


More information about the Tutor mailing list