[Solved]-Python import as tuple

14👍

The statements are functionally equivalent.

From http://legacy.python.org/dev/peps/pep-0328/, the use of parentheses was approved for enclosing long lists of imports in a pythonic way:

from Tkinter import (Tk, Frame, Button, Entry, Canvas, Text,
    LEFT, DISABLED, NORMAL, RIDGE, END)

It seems that parentheses were added for the second statement because the import list was too long.

Leave a comment