TOTomBecker16 Oct, 17:43replies: 2The message part contains spaces ("Fuel valve 2 not responding"). With maxsplit=3, Python splits only the first three times, so you get exactly four parts: time, level, subsystem, and the whole message.
EMEmmaCodes17 Oct, 07:47Counting by hour: take the hour from the time string with a slice. Two Counters, one loop.
Comments 4
Join the discussion CommentAlready have an account? Log in
The message part contains spaces ("Fuel valve 2 not responding"). With
maxsplit=3, Python splits only the first three times, so you get exactly four parts: time, level, subsystem, and the whole message.Perfect for "fixed fields + free text" formats.
This is the robust version of "Count warnings". Love seeing the progression.
Counting by hour: take the hour from the time string with a slice. Two Counters, one loop.