By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,630 Members | 1,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,630 IT Pros & Developers. It's quick & easy.

beeline through tkinter

P: n/a
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
Share this Question
Share on Google+
13 Replies


P: n/a
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

P: n/a

"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

P: n/a
"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

P: n/a

"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

P: n/a
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

P: n/a
"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

P: n/a

"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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.