LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-27-2008, 08:28 PM   #1
mugglemage
LQ Newbie
 
Registered: Apr 2008
Posts: 13

Rep: Reputation: 0
How do I import Tkinter into Python


I am a total n00b, but I am vastly interested in Python. I have what I believe is version 2.3 running on my Jornada 720 which is running matchbox and icewm (schweeeeeeeet!) and got a game programming book to finally realize my dream of creating a streetfighter game but with homeless vagrants. I get to the part where it says to type:

from Tkinter import*

and I get an error that tKinter is not a recognized module, which is weird because this game book says it is native to 2.3. I tried to download 2.5.2 and got a tar file, and tried running it with:

tar -xvf python2.5.5.tar

and am getting "invalid tar magic"...

I just want tKinter, how would I go about re-enabling or reinstalling this?
 
Old 06-27-2008, 08:34 PM   #2
andymalato
LQ Newbie
 
Registered: Jun 2006
Distribution: Red Hat, Solaris, FreeBSD
Posts: 20

Rep: Reputation: 0
Hello,

You don't say want distro you are using, but usually this is installed as a seperate package. If you are using a Red Hat based distro such as Fedora or CentOS you should be able to install the tkinter package to get the functionality that you are looking for.

See:
http://wiki.python.org/moin/TkInter

for additional information.
 
Old 06-27-2008, 10:24 PM   #3
mugglemage
LQ Newbie
 
Registered: Apr 2008
Posts: 13

Original Poster
Rep: Reputation: 0
I am using a GPE Matchbox distro, http://freeshells.ch/~wicked74/j720/linux/index.html ... I am trying to run this on a Jornada 720, the palmtop pc... I wrote the guy who made the distro, he said he installed the full version, but I cannot get tkinter to work, and rpm does not work either... I would use ipkg, which is working to install other programs, but for some reason when I run ipkg update, which I assume would put tkinter in python, nothing happens, I get some text about an updated list and thats all...
 
Old 06-28-2008, 04:22 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,522

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
http://wiki.python.org/moin/TkInter
Quote:
Tkinter is Python's de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk.
Tkinter is not the only GuiProgramming toolkit for Python. It is however the most commonly used one...
The Tkinter wiki: http://tkinter.unpythonic.net/wiki/

Besides 'tkinter' you will also need 'tcl' and 'tk' AFAIK.

Rgds

Last edited by knudfl; 06-28-2008 at 04:24 AM.
 
Old 07-01-2008, 04:40 AM   #5
tur third
Member
 
Registered: Jun 2005
Location: Surrey, UK
Distribution: Ubuntu 10.04, 10.10
Posts: 187

Rep: Reputation: 24
Are you aware of pygame? If you want to write a game, that is what you need - it has a module for handling sprites etc. There is a good chance you will not have any reason to use tkinter.
 
Old 07-02-2008, 08:47 AM   #6
mugglemage
LQ Newbie
 
Registered: Apr 2008
Posts: 13

Original Poster
Rep: Reputation: 0
I have IceWM on a Jornada, and a very basic (read: almost mentally handicapped) knowledge of Linux. I tried yum and RPM, neither of which work. I am not sure how to get TCL or TK installed onto this thing, is there a way to get either those or this newfangled pygame using ipkg? I have gotten that to work... I am trying to be more help (I know this is a custom distribution) and I do have matchbox on here too, which seems to be more helpful, if that would work...
 
  


Reply

Tags
tkinter


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tkinter integration to python 2.3.4 gaddargarson Programming 1 03-09-2005 04:58 AM
Python and Tkinter 1337 Twinkie Fedora 2 08-03-2004 11:35 AM
Python: Tkinter. Chu Programming 0 11-10-2003 01:56 AM
Python and Tkinter Error Gerardoj Programming 1 11-08-2003 09:52 PM
importing trouble....python...regarding Tkinter maseby Programming 0 11-03-2003 01:54 PM


All times are GMT -5. The time now is 08:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration