5 Replies - 14067 Views - Last Post: 21 March 2011 - 12:47 PM Rate Topic: -----

#1 cyberwolfXXL  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 27-February 11

TKInter with python 3.2

Posted 27 February 2011 - 10:36 AM

Hi there

I'm new to Python an tkinter but I want to do a bigger project with that combination.

I installed Python 3.2 and PyQT and the new Eric IDe 5.5_1.

So now my question.

Where can I get an tkinter tutorial or example
The following example does not work

import tkinter
root = TK()
w = Label(..)
root.mainloop()


Does anyone know my fault?

Thanks Cyberwolf

Is This A Good Question/Topic? 1
  • +

Replies To: TKInter with python 3.2

#2 Motoma  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 452
  • View blog
  • Posts: 796
  • Joined: 08-June 10

Re: TKInter with python 3.2

Posted 27 February 2011 - 10:47 AM

Either of the following changes should get your code working:

from tkinter import *
root = Tk()
w = Label(..)
root.mainloop()



or:

import tkinter
root = tkinter.Tk()
w = tkinter.Label(..)
root.mainloop()



The difference is a) it's Tk, not TK, and B) you either need to import classes/functions/constants/modules from the module to use them directly, or reference the module in each call.
Was This Post Helpful? 2
  • +
  • -

#3 cyberwolfXXL  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 27-February 11

Re: TKInter with python 3.2

Posted 03 March 2011 - 01:18 PM

View PostMotoma, on 27 February 2011 - 10:47 AM, said:

Either of the following changes should get your code working:

from tkinter import *
root = Tk()
w = Label(..)
root.mainloop()



or:

import tkinter
root = tkinter.Tk()
w = tkinter.Label(..)
root.mainloop()



The difference is a) it's Tk, not TK, and B) you either need to import classes/functions/constants/modules from the module to use them directly, or reference the module in each call.

Was This Post Helpful? 0
  • +
  • -

#4 cyberwolfXXL  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 27-February 11

Re: TKInter with python 3.2

Posted 03 March 2011 - 01:24 PM

Hi Motoma ,

thanks for your help


Cyberwolf
Was This Post Helpful? 0
  • +
  • -

#5 e-papa  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 45
  • Joined: 17-March 11

Re: TKInter with python 3.2

Posted 21 March 2011 - 02:21 AM

Hi I think i have some books you can use, they have been attached to this reply.

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#6 cyberwolfXXL  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 27-February 11

Re: TKInter with python 3.2

Posted 21 March 2011 - 12:47 PM

View Poste-papa, on 21 March 2011 - 02:21 AM, said:

Hi I think i have some books you can use, they have been attached to this reply.



Hi e.papa ,

thanks for your help. I'll look into these tutorials. Do you have some experience in Gui programming with Python?
I'm asking myself useing Tkinter or using PyQT. That looks more professional then TK.
What would you prefer fpr building a nice GUI?

greeting Cyberwolf
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1