473,545 Members | 1,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interfacing my chess client with GNU chess using python

Hello,
I have written a chess client using python which is a graphic
interface to play chess. It is at present a two player version,
players move their peices by clicking two squares on the board as
in any other chess clients.
Now i want to interface my program with the already available
gnuchess program. Basically i want to feed the user input to the
gnuchess and get the output and then display in my GUI. I have read
about Popen but i couldn't figure out how to do it. Is there any
other better ways of doing it. Any help would be appreciated.

--
-----8<----------8<----------8<----------8<----
Varun Hiremath
Undergraduate Student,
Aerospace Engg. Department,
Indian Institute of Technology Madras,
Chennai, India
-----------------------------------------------
Webpage : http://www.ae.iitm.ac.in/~ae03b032
-----------------------------------------------

Sep 18 '06 #1
1 2478

Varun Hiremath wrote:
Hello,
I have written a chess client using python which is a graphic
interface to play chess. It is at present a two player version,
players move their peices by clicking two squares on the board as
in any other chess clients.
Now i want to interface my program with the already available
gnuchess program. Basically i want to feed the user input to the
gnuchess and get the output and then display in my GUI. I have read
about Popen but i couldn't figure out how to do it. Is there any
other better ways of doing it. Any help would be appreciated.
The subprocess module may help you...

http://docs.python.org/dev/lib/module-subprocess.html
Will McGugan
--
http://www.willmcgugan.com

Sep 18 '06 #2

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

Similar topics

13
2072
by: Elaine Jackson | last post by:
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
0
1580
by: Gandalf | last post by:
Hi All! I have an interesting problem here. I have written a Delphi program that should connect to a server written in Python. I'm using a package called DCP for encryption in Delphi and the well known pycrypto library in Python. Delphi lib: {* DCPcrypt v2.0 written by David Barton (crypto@cityinthesky.co.uk) **********} Python lib: ...
12
2694
by: David Walker | last post by:
Hi I have a program which I need to interface with a webpage - the webpage will accept an input (probably a 'post' string from the program) and then will process it and needs to return a value. Is there an easy way to interface the program to do this? I have two questions: How can I call a webpage as simply as possible in c / c++...
5
3758
by: Will McGugan | last post by:
Hi folks, I've written a Python chess module that does the following. * Reads / Writes PGN files * Write FEN files * Validates moves * Lists legal moves * Detects check / mate / stalemate / 50 move rule / threefold repetition
11
2552
by: Gregc. | last post by:
G'day I am writing a chess program. Here is my code: #include <stdio.h> #include <stdlib.h> bool isInCheck (int krow, int kcol, int qrow, int qcol) { double check;
5
6897
by: Paolo Pantaleo | last post by:
Well Python is not a good language for writing a chess engine (even if a chess engine exists: http://www.kolumbus.fi/jyrki.alakuijala/pychess.html), but it could be grat for chess interfaces, for drawing boards, and similar things. I foudn out a library for these things (http://www.alcyone.com/software/chess/). Does anyone konw about more...
2
3110
by: CoreyWhite | last post by:
When playing games, perhaps the most simple is tic-tac-toe. The game has two simple strategies, one is defensive and the other offensive. It is not hard at first to learn how to tie games when playing an opponent. And then the next stage in development comes after you learn how to beat an opponent. You really can only employ either...
2
2023
by: shatranjchess | last post by:
I'm releasing a new python chess module called shatranj. You can get it from www.employees.org/~stannous/shatranj until I move the project to sourceforge or some other place. It's a text based (bitboard) chess engine that implements an alphabeta search with iterative deepening. It also has a small opening book and stores most of its...
1
2317
by: Jim Langston | last post by:
Windows. Situation: Using a Python program called OpenRPG. I have a program that displays form data (a character sheet) in C++. I am able in the C++ program to build a string and copy it into the clipboard, then paste it into the input in the running Python program. I would like to somehow automate this, that is, have the python instance...
0
7651
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7410
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5962
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4941
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1869
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1010
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
693
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.