few grid customization questions

hello, I'm currently learning wxpython while trying to implement an
interface to my sudoku solver, I'm investigating possibilities to
implement the board.

After careful inspection, i thought wxgrid is very nicely suited to my
purpose, but i cannot determine whether it will do a few things.

It will do everything you want, if you have the patience to make it
happen.

One of them is changing a grid border over a few grid. For example, in
sudoku, around 9 cells of the size 3x3 should have some kind of
different border around that 9 cells, different color, different
width, it doesn't matter, just is it possible to change the border in
someway over a span of several cells?

The Sudoku software you linked uses a wx.Grid to handle everything.
Aside from their use of the (deprecated and annoying) wxPython.wx import
(rather than the modern wx import), everything else should be fairly
understandable.

Another thing, is there a way of hiding the id of the cell? By
default, on top of the grid it is labeled as a - z, on the side it is
labeled as 1-9, however, i want to be able to hide the labels, is that
possible?

    grid.SetColLabelSize(0)
    grid.SetRowLabelSize(0)

Is it possible to set the grid size so that the user cannot change it?

    grid.DisableDragColSize()
    grid.DisableDragRowSize()

Is there a better way to represent a board that i have altogether missed?

wx.ListCtrl works pretty well, and I've generally been happy with
virtual list controls.

For reference, here is a program i found online that uses wxpython,
but i can't seem to run it from source, and it seems to be using grid,
but i can't isolate the things that made it that way, but it does have
a screenshot and is open source: http://www.stuvel.eu/sodoku

Any help would be much appreciated!

The writer of the application assumes that the software will be
installed in <pythonpath>/lib/site-packages/unrealtowersodoku , which is
a fairly common, if not silly assumption. If you install the software
via 'python setup.py install', it will install it as the author expects,
which should allow you to run it.

Alternatively, you can hack up the gui.py file and replace the imports
from the 'unrealtowersodoku' package into relative imports.

- Josiah

···

"Jason Wang" <randomtalk@gmail.com> wrote:

Jason Wang wrote:

the data for sudoku is organized as row:
alphabets, cols: numbers, the data is in dictionary,

You should look into using numpy arrays to store the data.

Numpy supports 2-d array, with 2-d slicing, and slicing as view behavior that would make the kinds of manipulations you need to do for Sudoku much easier.

http://numpy.scipy.org/

It's not just for Scientific computing...

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov