How tkinter and ttk works in python 3.5?
<p>i am learning Python and i have a question about .grid() method.
In the example the author gave, he is making imports with an * like so:</p>

<pre><code>from tkinter import *
from tkinter import ttk, filedialog, messagebox
import base64
import json
import os
from bs4 import BeautifulSoup
import requests
</code></pre>

<p>then, he creates the root window, and the main frame, like this:</p>

<pre><code>_root = Tk() # tkinter object, main window
_root.title('Scrape app') # window title
_root.resizable(width=False, height=False)
_mainframe = ttk.Frame(_root, padding='5 5 5 5')
_mainframe.grid(row=0, column=0, sticky=(E, W, N, S))
</code></pre>

<p>So far so good, i catch it all. The problem begins when he says that importing with * is not a good practice because of names collisions, so in one of my attempts to create something similar thinking of good practice, i did this:</p>

<pre><code>import tkinter as tk
from tkinter import ttk, messagebox, filedialog
import base64
import json
import os
from bs4 import BeautifulSoup
import requests

    root_window = tk.Tk()
    root_window.title('My first attemp of custom guiscrape')
    root_window.resizable(width=False, height=False)
    # First Frame
    g_main_frame = ttk.Frame(root_window, padding='5 5 5 5')
    g_main_frame.grid(row=0, column=0, sticky='NSWE')
    g_url_frame = ttk.LabelFrame(g_main_frame, text='URL', padding='5 5 5 5')
    g_url_frame.grid(row=0, column=0, sticky='EW')
    g_url_frame.columnconfigure(0, weight=1)
    g_url_frame.rowconfigure(0, weight=1)
    var_url = tk.StringVar()
    var_url.set('http://localhost:8000')
    g_url_entry = ttk.Entry(g_url_frame, width=40, textvariable=var_url)
    g_url_entry.grid(row=0, column=0, sticky='NESW', padx=5)
    root_window.mainloop()
</code></pre>

<p>The issue here is when _mainframe.grid() appears, the sticky option gets a tuple with four constants, in the author's example, but when i try giving a tuple in my attempt i get an error, constant E is not defined, so i have to use a string like 'NEWS', differing a lot from author's approach (N, E, W, S).</p>

<p>Is it a difference with the grid method from tkinter and ttk? what could be the best approach to use it? i can't find more documentation about ttk that can solve my doubt, Hope you can help!</p>