Python 根据值的不同长度,将键和值的数组拆分为多个数组

Python 根据值的不同长度,将键和值的数组拆分为多个数组,python,list,Python,List,假设我有一个Python列表,其方式如下: ['Comment by user14 [ 12/Apr/06 ]', 'Although I wish could have a few more buttons', 'Comment by user14 [ 12/Apr/06 ]', 'I am satisfied with the changes', 'Comment by user14 [ 12/Apr/06 ]', 'I just received a call stating t

假设我有一个Python列表,其方式如下:

['Comment by user14 [ 12/Apr/06 ]',
 'Although I wish could have a few more buttons',
 'Comment by user14 [ 12/Apr/06 ]',
 'I am satisfied with the changes',
 'Comment by user14 [ 12/Apr/06 ]',
 'I just received a call stating the issue has been resolved',
 'Comment by user12 [ 11/Apr/06 ]',
 'Nothing is responding', 
 'Please revert ASAP',
 'Comment by user50 [ 10/Apr/06 ]',
 'None of the tabs are loading any data.',
 'Comment by user54 [ 10/Apr/06 ]',
 'This seems very weird! I am not able to access any of the ',
 'changes that I made to this table yesterday. I wonder what is',
 'going on. Someone needs to have a look into this.',
 'Comment by user56 [ 09/Apr/06 ]',
 'Unable to access the shared drive.']
我想把这张桌子分成几个列表,比如-

['Comment by user14 [ 12/Apr/06 ]',
 'Although I wish could have a few more buttons']
['Comment by user14 [ 12/Apr/06 ]',
 'I am satisfied with the changes']
['Comment by user14 [ 12/Apr/06 ]',
 'I just received a call stating the issue has been resolved']
['Comment by user12 [ 11/Apr/06 ]',
 'Nothing is responding']
['Comment by user12 [ 11/Apr/06 ]',
 'Nothing is responding', 
 'Please revert ASAP']
['Comment by user54 [ 10/Apr/06 ]',
 'This seems very weird! I am not able to access any of the ',
 'changes that I made to this table yesterday. I wonder what is',
 'going on. Someone needs to have a look into this.']
etc

可能吗?我想不出一个逻辑。“Comment by…”是键,其后的行是注释。这些行可以是一行或多行,“CommentBy…”行可以由同一用户在同一天多次出现,我希望是否有办法获得每天的值。提前谢谢

这应该有效:

def是_标题(文本):
返回text.lower().startswith(“注释人”)
数据分割=[]如果是数据头(数据[0]),否则[[]
对于数据中的项目:
如果是_标题(项目):
数据分割。追加([项目])
其他:
数据分割[-1]。追加(项)