thank you so much Mr. Gauld that really helped<br><br><div><span class="gmail_quote">On 8/18/06, <b class="gmail_sendername">Alan Gauld</b> &lt;<a href="mailto:alan.gauld@freenet.co.uk">alan.gauld@freenet.co.uk</a>&gt; wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; Mr. Kuhlman it says python is not configured for tk.<br><br>Gaarrgh! Why do linux distros do this? Stooopid...
<br><br>You will need to fetch another version of Python with<br>Tk support built in. Its a compile time option so you can<br>either fetch the source an build it yourself or find a Suse<br>package with Tk support already selected.
<br><br>Its really stupid for Suse to do that, it only saves a tiny<br>amount of space and means you can't run any programs<br>based on Tkinter...<br><br>&gt; but on another note does anyone know how to make a 2d array?<br>
<br>This should probably be a separate post.<br><br>Also can you change the subject line in your posts so people<br>can fiind the thread easily. I've changed it on this one to pick<br>up the 2D array issue....<br><br>A 2D array is just a table. There are several ways to do that
<br>in Python but the easiest is just a list of lists: Think of a chess<br>game as an example where the boars is represented by<br>an 8x8 2D array:<br><br>chessBoard = [<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0],
<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;[0,0,0,0,0,0,0,0]<br>]<br><br>Now you can access the third row, 4th column with:<br>
<br>chessBoard[2][3]&nbsp;&nbsp; # remember zero indexing!<br><br>Is that clear?<br><br>You can also use tuples similarly, or nested dictionaries.<br>A lot will depend on the data you are storing and how you<br>want to access it.<br>
<br>Finally you can create a Class with bespoke methods to<br>more closely model your problem, but the class will usaually<br>have one of the above solutions internally anyhow!<br><br>HTH.<br><br>Alan Gauld<br>Author of the Learn to Program web site
<br><a href="http://www.freenetpages.co.uk/hp/alan.gauld">http://www.freenetpages.co.uk/hp/alan.gauld</a><br></blockquote></div><br>