condensing/reducing vertical spacing between widgets in tkinter (Python) (AKA: setting vertical line/text spacing/padding)
<p>Here's my program:</p>

<pre><code>import tkinter as tk 

#Create main window object 
root = tk.Tk()

#build GUI
for i in range(5):
    tk.Label(root, text="hello", height=0).grid(row=i)

#mainloop
root.mainloop()
</code></pre>

<p>It produces the following (running in Xubuntu 16.04 LTS)</p>

<p><a href="https://i.stack.imgur.com/UmTmH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UmTmH.png" alt="enter image description here"></a></p>

<p>Notice all that extra vertical space between the lines of text. I don't want that! How do I decrease it?</p>

<p>If I run this code instead:</p>

<pre><code>import tkinter as tk 

#Create main window object 
root = tk.Tk()

#build GUI
for i in range(5):
    tk.Label(root, text="hello", height=0).grid(row=i)
    tk.Grid.rowconfigure(root, i, weight=1) #allow vertical compression/expansion to fit window size after manual resizing

#mainloop
root.mainloop()
</code></pre>

<p>...it opens up and <em>initially looks exactly the same as before,</em> but now I can <em>manually</em> drag the box vertically to shrink it, like so:</p>

<p><a href="https://i.stack.imgur.com/D4mHc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D4mHc.png" alt="enter image description here"></a></p>

<p>Notice how much more vertically-compressed it is! <strong>But, how do I do this programatically</strong>, so I don't have to <em>manually</em> drag it to make it this way? I want to set this tight vertical spacing from the start, but no matter which parameters I change in <code>Label</code>, <code>grid</code>, or <code>rowconfigure</code> I can't seem to make it work without me manually dragging the box with the mouse to resize and vertically compress the text.</p>