0
from Tkinter import *

from tkinter import ttk

import Tkinter



master = Tk()

Lb1 = Listbox(master)
Lb1.insert(1, "Porshe-P9X1")
Lb1.insert(2, "Porshe-MACAN")
Lb1.insert(3, "Porshe-Facelift")
Lb1.insert(4, "Porshe-Reserved")

w = ttk.Combobox(master, values = Paramesh , ramesh)

Lb1.pack()
w.pack()

master.mainloop()

I am getting the error while executing the above mentioned code. can anyone explain me why it is throwing the error?

4
  • & what is the error,if i may ask? Commented Feb 26, 2014 at 5:22
  • you'd better google with the error code SyntaxError: non-keyword arg after keyword arg first next time ;) Commented Feb 26, 2014 at 5:25
  • Why are you importing Tkinter 3 different ways? Commented Feb 26, 2014 at 5:25
  • Post the error which you are getting. Commented Feb 26, 2014 at 5:37

1 Answer 1

2
ttk.Combobox(master, values = Paramesh , ramesh)

All the named key-value paired parameters should follow normal parameters, like this

ttk.Combobox(master, "ramesh", values = "Paramesh")

Or if you wanted to pass both the names as values, you should be preparing a list here

ttk.Combobox(master, values = ["Paramesh", "ramesh"])

Edit: As falsetru commented in the answer, you are importing both Tkinter (Python 2.x), tkinter (Python 3.x).

Sign up to request clarification or add additional context in comments.

3 Comments

Another problem: OP is importing both Tkinter (Python 2.x), tkinter (Python 3.x). (+ ttk is a top-level module in Python 2.x, a submodule of tkinter in Python 3.x)
In addition to that, according to ttk.Combobox docstring, it accepts only one positional argument (master). Here's a working example.
@falsetru You should have posted that as a separate answer :) After looking at that example, I believe the edited answer would be what he is trying to do, because the strings in the list are Indian names :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.