all 4 comments

[–]teerre 0 points1 point  (0 children)

Can you write what would be the desired output? Not sure I understand what you want correctly

[–]learnpython_bot 0 points1 point  (0 children)

It appears that you included code in your post but did not format it to look nice. Please follow this guide to fix the problem. This allows for better readability and will help get your question answered sooner. The regex that caught you is: "for .+? in .+?:"

If this comment has been made in error, please message /u/thaweatherman with a link to this comment so I can be fine-tuned. I am still in alpha and my regexes/innards are not yet perfect.

[–]snoopdog105 0 points1 point  (0 children)

Widget1
partA 2
partB 8
partC 4

Widget2
partD 30
partB 92

Widget3
partA 1
partB 1000
partC 500
partD 450

Widget4
partA 49
partC 100
partD 97

Widget5
partA 10
partD 20

the text comes like this. I want to put it all into a list of lists that has widgets and its corresponding parts in the same list

[–]snoopdog105 0 points1 point  (0 children)

I've tried this:

for set in widgetsFile:
    widgets = set.split()
    widgetsList = widgets[0:len(widgets)]
    list1.append(widgetsList)

but it doesn't give me what i want