On Saturday, February 13, 2016 at 10:41:20 PM UTC-6, Veek. M wrote:
> how do i replace the 'Ebay' bit with a variable so that I
> can load any class via cmd line.

Is this what you're trying to do? 

(Python2.x code)
>>> import Tkinter as tk
>>> classNames = ["Button", "Label"]
>>> root = tk.Tk()
>>> for className in classNames:
        classN = getattr(tk, className)
        instanceN = classN(root, text=className)
        instanceN.pack()
    
Note: You won't need to call "mainloop" when testing this
code on the command line, only in a script or in the IDLE
shell.

>>> root.mainloop() 
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to