Tkinter with Kivy

1,402 views
Skip to first unread message

Dev

unread,
Dec 15, 2013, 10:47:04 PM12/15/13
to kivy-...@googlegroups.com
Hey guys, I'm new to Kivy and Python so sorry if this is an odd question but how can I import Tkinter along with Kivy? I only want the Open File Dialog from Tkinter, because I'm creating a program to be used on Windows and Tkinter's file browser is much faster and more intuitive for a basic Windows application. The rest of the GUI is all Kivy though because it looks much better and was faster to design.

Can anyone help me? I've added this to the top of my Kivy App
from Tkinter import Tk
from tkFileDialog import askopenfilename

But when I run it, it says "ImportError: no module named Tkinter". I have regular (non-Kivy) Python installed as well and those import lines work when using the the Python console. I've tried copying the tkinter folder from my default python directory into the kivy directory but that didn't help at all.

Also, if anyone knows how I can get a default Windows File Browser dialog in Kivy without having to import Tkinter, that'd be great too. Thanks!

Dev

unread,
Dec 16, 2013, 1:48:03 AM12/16/13
to kivy-...@googlegroups.com
Nevermind, I got it. Had to copy the folder "tcl" to "Kivy\Kivy-1.7.2-w32\Python" and the folder "lib-tk" to "Kivy\Kivy-1.7.2-w32\Python\Lib"

Frank Martin

unread,
Mar 15, 2014, 11:44:47 AM3/15/14
to kivy-...@googlegroups.com
Thanks for posting the solution, saved me time to figure that out

Op maandag 16 december 2013 07:48:03 UTC+1 schreef Dev:

David Vanderschel

unread,
Oct 9, 2015, 11:34:47 AM10/9/15
to Kivy users support
I note that, in the Kivy-1.9.0-py2.7-win32-x86 distribution, Tkinter is already included.  I tried it on a Windows 10 laptop with a touch screen, and it handles touch input better than I expected.  (No way for multitouch though.)  It sees long press as right mouse down/up.
Reply all
Reply to author
Forward
0 new messages