python - Tkinter 'label' widget - Newlines adding space randomly -
I am trying to create a 'label' widget that contains help for my program. Assuming my label widget is called 'menu', I use it:
Menu ['text'] = '1 \ N2. \ N3. \ N4. \ N5. ' Something like this should be output:
1. 2. 3. 4. 5. However, it does output:
1 2 3. 4. 5. < / Pre> What am I doing?
label when creating your anchor and < Set the code> justification option like: myLabel = label (self, text = '1. \ N2. \ N3. \ N4. \ N5.', Anchor = W, Justify = left) anchor = w your text in the west (hence the w ) label , While justify = LEFT will ensure that any additional lines are given appropriate support for the text.
Comments
Post a Comment