473,394 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

beeline through tkinter

I'm about to tackle tkinter, but here's the thing: The only kind of GUI I want
to work on is a chessboard (an 8x8 grid of images that can be "moved around").
So before I start, I'm asking the room at large: Is there some way of going
directly to what I'm interested in? Any help will be very much appreciated.

Peace
Jul 18 '05 #1
13 2063
Elaine Jackson wrote:
I'm about to tackle tkinter, but here's the thing: The only kind of GUI I want
to work on is a chessboard (an 8x8 grid of images that can be "moved around").
So before I start, I'm asking the room at large: Is there some way of going
directly to what I'm interested in? Any help will be very much appreciated.


If you don't already have it, download the source distribution of Python and go
to the Demo/tkinter/matt sub-directory. There are many examples here that you
can use to do what you want; see for example canvas-moving-w-mouse.py

HTH
--
- Eric Brunel <eric dot brunel at pragmadev dot com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com

Jul 18 '05 #2

"Elaine Jackson" wrote ...
I'm about to tackle tkinter, but here's the thing: The only kind of GUI I want to work on is a chessboard (an 8x8 grid of images that can be "moved around"). So before I start, I'm asking the room at large: Is there some way of going directly to what I'm interested in? Any help will be very much

appreciated.

Chess board huh? What are you going to do with a chess board and
python?

Just curious, :-)
Patrick

Jul 18 '05 #3
"Elaine Jackson" <el***************@home.com> wrote in message news:<qj6Xb.476569$JQ1.239547@pd7tw1no>...
I'm about to tackle tkinter, but here's the thing: The only kind of GUI I want
to work on is a chessboard (an 8x8 grid of images that can be "moved around").
So before I start, I'm asking the room at large: Is there some way of going
directly to what I'm interested in? Any help will be very much appreciated.

Peace


This isn't quite an answer to your question, but I've got exactly such
a Tkinter chessboard. It's only half-finished (I have a short
attention span for projects!), but it might give you some ideas:

http://magicpeacefarm.com/lonnie/chessboard.tar.gz

Let me know if you use it for anything interesting =)
It requires the Python Imaging Library (PIL)
Jul 18 '05 #4

"Lonnie Princehouse" <fn***@u.washington.edu> wrote in message
news:f7**************************@posting.google.c om...

| This isn't quite an answer to your question, but I've got exactly such
| a Tkinter chessboard. It's only half-finished (I have a short
| attention span for projects!), but it might give you some ideas:
|
| http://magicpeacefarm.com/lonnie/chessboard.tar.gz

This won't unzip for me. I get a message that says "Error reading header after
processing 0 entries".
Jul 18 '05 #5
So far I've got a script that translates a pgn file into text that can be
typeset in a chess font to produce a pictorial representation of the game in
question. With a graphical interface it will eventually evolve into a pgn
viewer/analyzer.

"RPM1" <rp**********@direcway.com> wrote in message
news:c0*************@ID-203708.news.uni-berlin.de...
|
| "Elaine Jackson" wrote ...
| > I'm about to tackle tkinter, but here's the thing: The only kind of GUI I
| want
| > to work on is a chessboard (an 8x8 grid of images that can be "moved
| around").
| > So before I start, I'm asking the room at large: Is there some way of
| going
| > directly to what I'm interested in? Any help will be very much
| appreciated.
|
| Chess board huh? What are you going to do with a chess board and
| python?
|
| Just curious, :-)
| Patrick
|
|
|
Jul 18 '05 #6
"Eric Brunel" <er*********@N0SP4M.com> wrote in message
news:c0**********@news-reader1.wanadoo.fr...

| If you don't already have it, download the source distribution of Python and
go
| to the Demo/tkinter/matt sub-directory. There are many examples here that you
| can use to do what you want; see for example canvas-moving-w-mouse.py

I don't know where to obtain this. Searching python.org with the phrase 'python
source distribution' turns up a bunch of stuff about using distutils.
Jul 18 '05 #7

"Elaine Jackson" <el***************@home.com> wrote ...
So far I've got a script that translates a pgn file into text that can be
typeset in a chess font to produce a pictorial representation of the game in question. With a graphical interface it will eventually evolve into a pgn
viewer/analyzer.


Cool. Over the years I've tinkered with very basic chess programs
written in various programming languages. I found python to be too
slow, (although I wonder if Numeric or Psyco might make it feasible).

There is a chess program written in python:

http://www.kolumbus.fi/jyrki.alakuijala/pychess.html

but it is very slow and pretty weak.

Good luck with the viewer,
Patrick

Jul 18 '05 #8
"Elaine Jackson" <el***************@home.com> wrote in message news:<XtcXb.493232$ts4.254427@pd7tw3no>...
"Lonnie Princehouse" <fn***@u.washington.edu> wrote in message
news:f7**************************@posting.google.c om...

| This isn't quite an answer to your question, but I've got exactly such
| a Tkinter chessboard. It's only half-finished (I have a short
| attention span for projects!), but it might give you some ideas:
|
| http://magicpeacefarm.com/lonnie/chessboard.tar.gz

This won't unzip for me. I get a message that says "Error reading header after
processing 0 entries".


Ah, the joys of Windows! I'll put up a zipped version-

http://magicpeacefarm.com/lonnie/chessboard.zip

I've noticed that Windows likes to add another ".tar" when it
downloads tar/gzipped archives, and at least Winzip can't figure it
out. You can usually fix this by renaming the file to have a
".tar.gz" extension instead of ".tar.gz.tar". This isn't at all
obvious if you have show-extensions turned off.

-L
Jul 18 '05 #9
Yes, Python is probably too slow for a competitive chess engine.
Pychess works, but it's about two orders of magnitude slower than it
would be in C. I haven't tried it with Psyco; that might help
considerably.

That said, it's a breeze to write C extensions for Python. It makes a
lot of sense to write the GUI in Python and have the crunchy bits in
C.

(It took me a few hours to write the chess board GUI posted in this
thread, and it would have taken a lot longer in C, not to mention the
portability advantage of an interpreted language)

"RPM1" <rp**********@direcway.com> wrote in message news:<c0*************@ID-203708.news.uni-berlin.de>...
"Elaine Jackson" <el***************@home.com> wrote ...
So far I've got a script that translates a pgn file into text that can be
typeset in a chess font to produce a pictorial representation of the game

in
question. With a graphical interface it will eventually evolve into a pgn
viewer/analyzer.


Cool. Over the years I've tinkered with very basic chess programs
written in various programming languages. I found python to be too
slow, (although I wonder if Numeric or Psyco might make it feasible).

There is a chess program written in python:

http://www.kolumbus.fi/jyrki.alakuijala/pychess.html

but it is very slow and pretty weak.

Good luck with the viewer,
Patrick

Jul 18 '05 #10
On Fri, 13 Feb 2004 22:57:03 GMT, Elaine Jackson <el***************@home.com> wrote:
"Eric Brunel" <er*********@N0SP4M.com> wrote in message
news:c0**********@news-reader1.wanadoo.fr...

| If you don't already have it, download the source distribution of Python and
go
| to the Demo/tkinter/matt sub-directory. There are many examples here that you
| can use to do what you want; see for example canvas-moving-w-mouse.py

I don't know where to obtain this. Searching python.org with the phrase 'python
source distribution' turns up a bunch of stuff about using distutils.


Sometimes you cannot just search, you have to think as well.
http://www.python.org/download/ , near the top of the screen:

http://www.python.org/ftp/python/2.3.3/Python-2.3.3.tgz

/Jorgen

--
// Jorgen Grahn <jgrahn@ ''If All Men Were Brothers,
\X/ algonet.se> Would You Let One Marry Your Sister?''
Jul 18 '05 #11

"Lonnie Princehouse" <fn***@u.washington.edu> wrote in message
news:f7**************************@posting.google.c om...
Yes, Python is probably too slow for a competitive chess engine.
Pychess works, but it's about two orders of magnitude slower than it
would be in C. I haven't tried it with Psyco; that might help
considerably.

That said, it's a breeze to write C extensions for Python. It makes a
lot of sense to write the GUI in Python and have the crunchy bits in
C.


Yeah but there are already GUI's, (Winboard and Arena), that you can
run various chess engines in. That negates the need to write the GUI
part, so you're just left with the engine in C.

I've written move generators in Python, (with Psyco), and they achieve
speeds around 10,000 - 20,000 nodes per second on a machine where
C code can do 300,000 - 500,000 nodes per second. Java and C#
were around 80,000 - 120,000.

Of course the trick with Python is to *not* wrte a straight port of C code
but to use the built in functionality of Python to some kind of advantage.
I have not achieved that yet.

Patrick

Jul 18 '05 #12
That's got it. Thanks very much.

"Lonnie Princehouse" <fn***@u.washington.edu> wrote in message
news:f7**************************@posting.google.c om...
| "Elaine Jackson" <el***************@home.com> wrote in message
news:<XtcXb.493232$ts4.254427@pd7tw3no>...
| > "Lonnie Princehouse" <fn***@u.washington.edu> wrote in message
| > news:f7**************************@posting.google.c om...
| >
| > | This isn't quite an answer to your question, but I've got exactly such
| > | a Tkinter chessboard. It's only half-finished (I have a short
| > | attention span for projects!), but it might give you some ideas:
| > |
| > | http://magicpeacefarm.com/lonnie/chessboard.tar.gz
| >
| > This won't unzip for me. I get a message that says "Error reading header
after
| > processing 0 entries".
|
| Ah, the joys of Windows! I'll put up a zipped version-
|
| http://magicpeacefarm.com/lonnie/chessboard.zip
|
| I've noticed that Windows likes to add another ".tar" when it
| downloads tar/gzipped archives, and at least Winzip can't figure it
| out. You can usually fix this by renaming the file to have a
| ".tar.gz" extension instead of ".tar.gz.tar". This isn't at all
| obvious if you have show-extensions turned off.
|
| -L
Jul 18 '05 #13
On Fri, 13 Feb 2004 17:26:36 +0100, Eric Brunel
<er*********@N0SP4M.com> wrote:
Elaine Jackson wrote:
I'm about to tackle tkinter, but here's the thing: The only kind of GUI I want
to work on is a chessboard (an 8x8 grid of images that can be "moved around").
So before I start, I'm asking the room at large: Is there some way of going
directly to what I'm interested in? Any help will be very much appreciated.


If you don't already have it, download the source distribution of Python and go
to the Demo/tkinter/matt sub-directory. There are many examples here that you
can use to do what you want; see for example canvas-moving-w-mouse.py


Even better yet (each command goes in a single line):

prompt> cvs -d:pserver:an*******@cvs.sourceforge.net:/cvsroot/python
login

[hit Enter Key when prompeted for a password]

prompt> cvs -z3
-d:pserver:an*******@cvs.sourceforge.net:/cvsroot/python checkout -d
python_demo_scripts -P dist/src/Demo

prompt> cvs -z3
-d:pserver:an*******@cvs.sourceforge.net:/cvsroot/python checkout -d
python_tool_scripts -P dist/src/Tools

And you'll have more examples than you can shake a stick at. Beats
downloading an 8 Mb tarball compressed with bzip2 at any rate.

If you are CVS challenged (not surprising if you haven't used anything
but Windows or MacOS during the duration of your natural life), go to
http://www.wincvs.org/ and download the GUI client and to
http://cvs.cvshome.org/ for a copy of the CVS book.

Alejo

--
The limits of my language are the limits of my world.
Ludwig Wittgenstein

Get in touch through <http://dradul.tripod.com/>
Jul 18 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Josh | last post by:
Caution, newbie approaching... I'm trying to come up with a very simple Tkinter test application that consists of a window with a drop-down menu bar at the top and a grid of colored rectangles...
0
by: syed_saqib_ali | last post by:
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust...
1
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.