Install Tkinter for Windows 7 64-bit

2013-11-11 Thread jonas . thornvall
I have installed Python 3.3, and i want to add a library with some basic 
functions like canvas and basic geomteric objects, fonts etc. Preferably 
something similar to the Javascript canvas.

I've looked for graphic packages, and from what i can see something called 
Tkinter may be what i look for.

However i have no luck install it, i installed something called Visual studio 
in hope it would incorporate Tkinter, but it did not and it also do not seem to 
work with 3.3 only 3.1 and below.

Next i found ActiveStateTCL that from what i could see incorporated Tkinter 
library?

But i have no luck runn the Tkinter example file i downloaded in idel, it still 
says no module called Tkinter.


===
Traceback (most recent call last):
  File D:\Python33\test2.py, line 16, in module
from Tkinter import Tk, Canvas, Frame, BOTH
ImportError: No module named 'Tkinter'
===

Maybe i should use some other module, i just need a canvas and the basic 
geometric objects functions line,rectangle,circle and some font.

JT
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread Tim Golden
On 11/11/2013 16:38, jonas.thornv...@gmail.com wrote:
 I have installed Python 3.3, and i want to add a library with some
 basic functions like canvas and basic geomteric objects, fonts etc.
 Preferably something similar to the Javascript canvas.
 
 I've looked for graphic packages, and from what i can see something
 called Tkinter may be what i look for.
 
 However i have no luck install it, i installed something called
 Visual studio in hope it would incorporate Tkinter, but it did not
 and it also do not seem to work with 3.3 only 3.1 and below.
 
 Next i found ActiveStateTCL that from what i could see incorporated
 Tkinter library?
 
 But i have no luck runn the Tkinter example file i downloaded in
 idel, it still says no module called Tkinter.
 
 
 === Traceback (most recent call last): File D:\Python33\test2.py,
 line 16, in module from Tkinter import Tk, Canvas, Frame, BOTH 
 ImportError: No module named 'Tkinter' ===
 
 Maybe i should use some other module, i just need a canvas and the
 basic geometric objects functions line,rectangle,circle and some
 font.

I'll let others comment on the use of Tk. But...

The Tkinter module has been reorganised under Python 3.x:

  http://docs.python.org/3.3/library/tkinter.html#module-tkinter

You're presumably working from a Python 2.x example

TJG
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread Tim Golden
On 11/11/2013 16:38, jonas.thornv...@gmail.com wrote:
 === Traceback (most recent call last): File D:\Python33\test2.py,
 line 16, in module from Tkinter import Tk, Canvas, Frame, BOTH 
 ImportError: No module named 'Tkinter' ===

In addition, I really don't recommend running your test scripts straight
out of the Python install directory. Consider using a separate dev
area somewhere else.

TJG
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread jonas . thornvall
Here is the example file i have tried.

#!/usr/bin/python
# -*- coding: utf-8 -*-


ZetCode Tkinter tutorial

This program draws three
rectangles filled with different
colors.

author: Jan Bodar
last modified: January 2011
website: www.zetcode.com


from Tkinter import Tk, Canvas, Frame, BOTH


class Example(Frame):
  
def __init__(self, parent):
Frame.__init__(self, parent)   
 
self.parent = parent
self.initUI()

def initUI(self):
  
self.parent.title(Colors)
self.pack(fill=BOTH, expand=1)

canvas = Canvas(self)
canvas.create_rectangle(30, 10, 120, 80, 
outline=#fb0, fill=#fb0)
canvas.create_rectangle(150, 10, 240, 80, 
outline=#f50, fill=#f50)
canvas.create_rectangle(270, 10, 370, 80, 
outline=#05f, fill=#05f)
canvas.pack(fill=BOTH, expand=1)



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread Mark Lawrence

On 11/11/2013 16:38, jonas.thornv...@gmail.com wrote:

I have installed Python 3.3, and i want to add a library with some basic 
functions like canvas and basic geomteric objects, fonts etc. Preferably 
something similar to the Javascript canvas.

I've looked for graphic packages, and from what i can see something called 
Tkinter may be what i look for.

However i have no luck install it, i installed something called Visual studio 
in hope it would incorporate Tkinter, but it did not and it also do not seem to 
work with 3.3 only 3.1 and below.

Next i found ActiveStateTCL that from what i could see incorporated Tkinter 
library?

But i have no luck runn the Tkinter example file i downloaded in idel, it still 
says no module called Tkinter.


===
Traceback (most recent call last):
   File D:\Python33\test2.py, line 16, in module
 from Tkinter import Tk, Canvas, Frame, BOTH
ImportError: No module named 'Tkinter'
===

Maybe i should use some other module, i just need a canvas and the basic 
geometric objects functions line,rectangle,circle and some font.

JT



Renamed in Python 3 to tkinter see 
http://www.python.org/dev/peps/pep-3108/#tkinter-package


--
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread Chris “Kwpolska” Warrick
On Mon, Nov 11, 2013 at 5:38 PM,  jonas.thornv...@gmail.com wrote:
 But i have no luck runn the Tkinter example file i downloaded in idel, it 
 still says no module called Tkinter.
IDLE*
 ===
 Traceback (most recent call last):
   File D:\Python33\test2.py, line 16, in module
 from Tkinter import Tk, Canvas, Frame, BOTH
 ImportError: No module named 'Tkinter'
 ===

In Python 3, 'Tkinter' was renamed to 'tkinter' (both sans quotes).
Please change the file to reflect that (as the traceback points out,
line 16).

-- 
Chris “Kwpolska” Warrick http://kwpolska.tk
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread jonas . thornvall
Den måndagen den 11:e november 2013 kl. 17:43:12 UTC+1 skrev Chris “Kwpolska” 
Warrick:
 On Mon, Nov 11, 2013 at 5:38 PM,  jonas.thornv...@gmail.com wrote:
 
  But i have no luck runn the Tkinter example file i downloaded in idel, it 
  still says no module called Tkinter.
 
 IDLE*
 
  ===
 
  Traceback (most recent call last):
 
File D:\Python33\test2.py, line 16, in module
 
  from Tkinter import Tk, Canvas, Frame, BOTH
 
  ImportError: No module named 'Tkinter'
 
  ===
 
 
 
 In Python 3, 'Tkinter' was renamed to 'tkinter' (both sans quotes).
 
 Please change the file to reflect that (as the traceback points out,
 
 line 16).
 
 
 
 -- 
 
 Chris “Kwpolska” Warrick http://kwpolska.tk
 
 PGP: 5EAAEA16
 
 stop html mail | always bottom-post | only UTF-8 makes sense

Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread MRAB

On 11/11/2013 16:43, jonas.thornv...@gmail.com wrote:

Here is the example file i have tried.

#!/usr/bin/python
# -*- coding: utf-8 -*-


ZetCode Tkinter tutorial

This program draws three
rectangles filled with different
colors.

author: Jan Bodar
last modified: January 2011
website: www.zetcode.com


from Tkinter import Tk, Canvas, Frame, BOTH


class Example(Frame):

 def __init__(self, parent):
 Frame.__init__(self, parent)

 self.parent = parent
 self.initUI()

 def initUI(self):

 self.parent.title(Colors)
 self.pack(fill=BOTH, expand=1)

 canvas = Canvas(self)
 canvas.create_rectangle(30, 10, 120, 80,
 outline=#fb0, fill=#fb0)
 canvas.create_rectangle(150, 10, 240, 80,
 outline=#f50, fill=#f50)
 canvas.create_rectangle(270, 10, 370, 80,
 outline=#05f, fill=#05f)
 canvas.pack(fill=BOTH, expand=1)

That looks like it was written for Python 2 because in Python 3 the 
module is named tkinter.


It's also lacking the part where it calls the .mainloop method.


from tkinter import Tk, Canvas, Frame, BOTH

class Example(Frame):

def __init__(self, parent):
Frame.__init__(self, parent)

self.parent = parent
self.initUI()

def initUI(self):

self.parent.title(Colors)
self.pack(fill=BOTH, expand=1)

canvas = Canvas(self)
canvas.create_rectangle(30, 10, 120, 80,
outline=#fb0, fill=#fb0)
canvas.create_rectangle(150, 10, 240, 80,
outline=#f50, fill=#f50)
canvas.create_rectangle(270, 10, 370, 80,
outline=#05f, fill=#05f)
canvas.pack(fill=BOTH, expand=1)

def main():

root = Tk()
#root.geometry(250x150+300+300)
app = Example(root)
root.mainloop()

if __name__ == '__main__':
main()

--
https://mail.python.org/mailman/listinfo/python-list