sneekula 969 Nearly a Posting Maven

So you want to test drive some wxPython widgets without all that OOP stuff, here are some examples how to do this:

# test a wxPython combobox selection

import wx

def combo_select(event):
    color = combo.GetValue()
    frame.SetTitle(color)


app = wx.App(0)
frame = wx.Frame(None, -1, "wx.ComboBox", size=(220, 40))

# set up the choices for the listbox part of the combobox
choice_list = ['red', 'green', 'blue', 'yellow','white', 'magenta']
# create a combobox widget
combo = wx.ComboBox( frame, -1, choices=choice_list)
# set initial value
combo.SetValue('red')
# click on a dropdown choice to select it
combo.Bind(wx.EVT_COMBOBOX, combo_select)

frame.Center()
frame.Show()
app.MainLoop()

One more for the Gipper:

# test wxPython checkbox selections

import wx

def on_action(event):
    s = ""
    if cb1.IsChecked():
        s += "cb1 (red) is checked  "
    if cb2.IsChecked():
        s += "cb2 (blue) is checked  "
    if not cb1.IsChecked() and not cb2.IsChecked():
        s = "none is checked"
    frame.SetTitle(s)


app = wx.App(0)
frame = wx.Frame(None, -1, "wx.CheckBox", size=(450, 79))

cb1 = wx.CheckBox(frame, -1, 'red', pos=(10, 10))
cb2 = wx.CheckBox(frame, -1, 'blue', pos=(10, 40))
# set checkbox cb1 to checked
cb1.SetValue(True)
# bind checkbox mouse click to an action
cb1.Bind(wx.EVT_CHECKBOX, on_action)
cb2.Bind(wx.EVT_CHECKBOX, on_action)
# initial call
on_action(None)

frame.Center()
frame.Show()
app.MainLoop()
sneekula 969 Nearly a Posting Maven

Yes Gloria, Tkinter has a combo box, but it's called an option menu. Here is an example:

# using Tkinter's Optionmenu() as a combobox

try:
    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk

def select():
    sf = "value is %s" % var.get()
    root.title(sf)
    # optional
    color = var.get()
    root['bg'] = color


root = tk.Tk()
# use width x height + x_offset + y_offset (no spaces!)
root.geometry("%dx%d+%d+%d" % (330, 80, 200, 150))
root.title("tk.Optionmenu as combobox")

var = tk.StringVar(root)
# initial value
var.set('red')

choices = ['red', 'green', 'blue', 'yellow','white', 'magenta']
option = tk.OptionMenu(root, var, *choices)
option.pack(side='left', padx=10, pady=10)

button = tk.Button(root, text="check value slected", command=select)
button.pack(side='left', padx=20, pady=10)

root.mainloop()
sneekula 969 Nearly a Posting Maven

Do us all a favor and don't use tabs for indentations!

sneekula 969 Nearly a Posting Maven

Should you decide to have fun with Python, be aware that the language has been modernized starting with version 3. I would recommend to start with the present version Python 3.1.1

Some examples of the older Python2 code will give you problems, but a number of good tutorials have been rewritten for version 3.

Dive Into Python is Mark Pilgrim's free online book, novice to pro, updated constantly, and rewritten for Python3 (check appendix A for 2to3 diffs). Get it at:

http://diveintopython3.org/


Another online book rewritten vor Python3 is at:
http://www.swaroopch.com/notes/Python_en:Table_of_Contents

Python has a commandline based interpreter called the the interactive shell, good for short one-line explorations. The books use it a lot, but the code looks goofy with lots of '>>>' and '...', so don't get too confused! Real Python code looks a lot more readable when written in an editor, saved as a .py file and run.

Right now Python3 gives you only two GUI toolkit choices, one is Tkinter (TCL based) and the other is PyQT (C++ based). PyGame (SDL/C++ based) is another GUI toolkit mostly used or games. It just came out for Python31. The popular wxPython (C++ based) has not been rewritten yet to work with Python3.

Here is a collection of coding examples that compare the GUI toolkits:
http://www.daniweb.com/forums/post866067.html#post866067

sneekula 969 Nearly a Posting Maven

Oh, well I can't find it in 2.6 or newer, maybe as sravan said that its outdated python org decided not to include it anymore

The binary windows installer of Pyhon26 or Python31 both have tkinter. In fact in Python31 Tkinter has been spruced up with the module ttk.

Vegaseat left this example somewhere on this forum:

'''
Python31 includes the Tkinter Tile extension module ttk.

Ttk comes with 17 widgets, 11 of which already exist in Tkinter:
Button, Checkbutton, Entry, Frame, Label, LabelFrame, Menubutton, 
PanedWindow, Radiobutton, Scale and Scrollbar 

The 6 new widget classes are:
Combobox, Notebook, Progressbar, Separator, Sizegrip and Treeview

You have to do some detective work on file
C:/Python31/Lib/tkinter/test/test_ttk/test_widgets.py
to figure out how these widgets work
'''

# ttk_notebook1.py
# exploring the Tkinter expansion module ttk notebook
# tested with Python 3.1 and Tkinter 8.5   by  vegaseat

import tkinter as tk
import tkinter.ttk as ttk

root = tk.Tk()
# use width x height + x_offset + y_offset (no spaces!)
root.geometry("%dx%d+%d+%d" % (300, 200, 100, 50))
root.title('test the ttk.Notebook')

nb = ttk.Notebook(root)
nb.pack(fill='both', expand='yes')

# create a child wdget for each page
f1 = tk.Frame(bg='red')
f2 = tk.Frame(bg='blue')
f3 = tk.Frame(bg='green')

# create the pages
nb.add(f1, text='page1')
nb.add(f2, text='page2')
nb.add(f3, text='page3')

# put a button widget on child f1
btn1 = tk.Button(f1, text='button1')
btn1.pack(side='left', anchor='nw', padx=3, pady=5)

root.mainloop()

Tkinter is small but powerful. The included Python IDE called 'IDLE' is based on Tkinter, as is the module turtle.

sneekula 969 Nearly a Posting Maven

The Python module re is your friend:

# finding a search word in a text file using regex module re

import re

search = 'like'
# also matches 'like!', but not 'likely'
pattern = r"\b%s\b" % search
#print(pattern)  # for testing only --> \blike\b
rc = re.compile(pattern, re.IGNORECASE)

test_text = """\
the word like has a very flexible range of uses
With LIKE you can use two likely wildcard characters in the pattern
Official site for People Like Us and Vicki Bennett
Celebs and Famous People who looks like other, um, things and stuff
There is most likely a sentence without the search word
This is what the test file looks like!
"""

fname = "SearchFile.txt"
# save the test text  to a file
fout = open(fname, "w")
fout.write(test_text)
fout.close()

# read the file back line by line
word_list = []
for line in open(fname):
    match = rc.search(line)
    if match:
        print(match.group(0))  # for test
        print(line)

"""my output -->
like
the word like has a very flexible range of uses

LIKE
With LIKE you can use two likely wildcard characters in the pattern

Like
Official site for People Like Us and Vicki Bennett

like
Celebs and Famous People who looks like other, um, things and stuff

like
This is what the test file looks like!
"""
sneekula 969 Nearly a Posting Maven

One must be convinced to convince others.
~~~ Stefan Zweig

sneekula 969 Nearly a Posting Maven

Please use an editor, hard to see what your indents are with that lousy pyshell!

sneekula 969 Nearly a Posting Maven

Judges can be disappointed, gardeners deflowered, celebrities defamed, horses desired, electricians delighted, musicians denoted, cowboys deranged, models deposed, tree surgeons debarked, programmers deprogrammed, dry cleaners depressed, sculptors disfigured, product testers detested, castle architects demoted, stock brokers distrusted, teachers degraded, wind farmers disgusted, insurance agents disclaimed, bankers disinterested, ...

sneekula 969 Nearly a Posting Maven

I write music which is better than it sounds.
~~~ Richard Wagner

sneekula 969 Nearly a Posting Maven

Never look at the trombones, it only encourages them.
~~~ Richard Wagner

sneekula 969 Nearly a Posting Maven

Just back from my GF's house, she served "foot longs" with sauerkraut on toasted pretzel buns. Plenty of Hefeweizen to make me happy.

sneekula 969 Nearly a Posting Maven

Red, white and blue yogurt, very patriotic!

sneekula 969 Nearly a Posting Maven

He thought
he was God
and I didn't

sneekula 969 Nearly a Posting Maven

The module turtle that comes with Python makes for interesting projects. Here is a function that draws a hexagon:

# explore module turtle (uses the Tkinter GUI toolkit)
# usually included in the Python2 and Python3  installation
# a function to draw 6 turtle lines to form a hexagon
# snee

import turtle as tu

tu.title('hexagon function')

def t_hexagon(x, y, side, color):
    """
    draw an equilateral hexagon, each side has length=side
    starting at coordinates x, y (upper side, right corner)
    """
    tu.up()  # pen up
    tu.goto(x, y)
    tu.down()  # pen down
    tu.color(color)
    for k in range(6):
        tu.right(360/6)
        tu.forward(side)

# optional ('normal' is default) ...
# values for speed are 'fastest' (no delay), 'fast', (delay 5ms),
# 'normal' (delay 10ms), 'slow' (delay 15ms), 'slowest' (delay 20ms)
#tu.speed('fastest')

# optional pen width (default is 1)
tu.width(2)

# turtle by default starts at x=0, y=0
# wich is the center of a (ca. 450x550) window
# pick +x units to the right, +y units up,
# -x units to the left, -y units down
x = 50
y = 100
side = 100
color = 'red'
t_hexagon(x, y, side, color)

# keep showing until window corner x is clicked
tu.done()

If you run this code, you will see that the hexagon rests on its side. Your challenge will be to rewrite the function so it will draw the hexagon resting on its tip.

sneekula 969 Nearly a Posting Maven

What woooee said was correct:

overwrite=""
while(overwrite!="Y".lower() and overwrite!="N".lower()):
    overwrite=raw_input()

Here "Y".lower() does not make any sense since it is simply 'y'

sneekula 969 Nearly a Posting Maven

When in doubt
test it out

sneekula 969 Nearly a Posting Maven

You have to read up on the slicing operator in the Python Manual.

Generally you can slice a sequence with [start: end: step]
By default start=0, end=len(seq), step=1
step=-1 goes from the end to the beginning of the sequence, hence your reverse.

For some nice slicing examples see post #4 at;
http://www.daniweb.com/forums/post104865.html#post104865

nunos commented: very clarifying post. link to good examples. +1
sneekula 969 Nearly a Posting Maven

Oops, DaniWeb is behaving goofy and made two copies of my code!

sneekula 969 Nearly a Posting Maven

I would stay away from module cturtle and use Python's own thoroughly tested module turtle. Here is a small code sample that shows you how to handle the turtle direction properly:

import math
import turtle as tu

base_length = 200
# the two sides are equal in an Isoceles triangle
side_length = 300

# angle shared by base and side
base_angle = math.degrees( math.acos((base_length/2.0)/side_length) )
# angle shared by sides
side_angle = 180 - base_angle*2

# values for speed are 'fastest' (no delay), 'fast', (delay 5ms),
# 'normal' (delay 10ms), 'slow' (delay 15ms), 'slowest' (delay 20ms)
#tu.speed('fastest')

# turtle by default starts at (x=0, y=0) center of display
# to center the triangle lift the pen up then move
# to the left by base_length/2 and down side_length/2 units
# now drop the pen down to start drawing
tu.up()
tu.goto(-base_length/2, -side_length/2)
tu.down()

tu.forward(base_length)
tu.left(180 - base_angle)
tu.forward(side_length)
tu.left(180 - side_angle)
tu.forward(side_length)

# keep showing until corner x is clicked
tu.done()
sneekula 969 Nearly a Posting Maven

If you are used to Python2 code, then Python3 is full of surprises. However they all make the language better! So, keep an open mind, use the 2to3.py utility and try to make the old code work.

sneekula 969 Nearly a Posting Maven

To do well in the search engine market you have to be quick, nimble and innovative. I don't think Google has much to fear from Microsoft.

sneekula 969 Nearly a Posting Maven

The early Gray Computers were cooled with flourinated hydrocarbon liquid. My problem would be the mess it makes when it leaks.

sneekula 969 Nearly a Posting Maven

Friday is still fish day for some of us, so I breaded some Alaskan Pollock with parmesan-mustard, baked it and served it with a zucchini and cabbage medley. My GF liked it a lot.

sneekula 969 Nearly a Posting Maven

hm, how about using the standard lib ? (python 2.6)

from itertools import permutations
letters = "abcd"
for p in permutations(letters):
    print ''.join(p)
""" my output --->
abcd
abdc
acbd
acdb
adbc
adcb
bacd
badc
bcad
bcda
bdac
bdca
cabd
cadb
cbad
cbda
cdab
cdba
dabc
dacb
dbac
dbca
dcab
dcba
"""

Looks like an important part of learning Python is to know what all those wonderful modules can do for you!

sneekula 969 Nearly a Posting Maven

This approach should work:

# 

def replace_one_two(name):
    """Switch letters in 2nd and 3rd position"""
    left = name[1]
    right = name[2]
    name.remove(left)
    name.remove(right)
    name.insert(1, right)
    name.insert(2, left)
    return name


def replace_three_four(name):
    """Switch letters in 3rd and 4th position"""
    left = name[2]
    right = name[3]
    name.remove(left)
    name.remove(right)
    name.insert(2, right)
    name.insert(3, left)
    return name

LETTERS = ["a", "b", "c", "d"]
letters = ["a", "b", "c", "d"]

while True:
    iterations = replace_three_four(letters)
    print letters
    iterations = replace_one_two(letters)
    print letters
    if letters == LETTERS:
        break

"""my output -->

['a', 'b', 'd', 'c']
['a', 'd', 'b', 'c']
['a', 'd', 'c', 'b']
['a', 'c', 'd', 'b']
['a', 'c', 'b', 'd']
['a', 'b', 'c', 'd']

"""
sneekula 969 Nearly a Posting Maven

I don't see the C!

BTW, not everybody knows this yet ~~~ gets(text); Very, very bad idea.

sneekula 969 Nearly a Posting Maven

public DBBase()
{
}
}

interesting C code.

sneekula 969 Nearly a Posting Maven

The recommended coding style for Python is:
Do your imports
Define your functions and/or classes
Do the main code

The bare minimum:
Define your functions before you use them in your main code

sneekula 969 Nearly a Posting Maven

It works well on my Windows XP computer! What does .swf stand for?

sneekula 969 Nearly a Posting Maven

Does not look like C code to me! What does it do here?

sneekula 969 Nearly a Posting Maven

Grid does not have anchor, but it has sticky:

rb[i].grid(row=i, column=0, sticky='w')
sneekula 969 Nearly a Posting Maven

Courier is the most common font to space all character equal.

Lingson commented: Nice and direct solution! +1
sneekula 969 Nearly a Posting Maven

Right now you simply have to use one of the many image view utilities to convert your jpg files to gif files.

sneekula 969 Nearly a Posting Maven
sneekula 969 Nearly a Posting Maven

If the user of your program has to select from a fixed list of choices, the wx.SingleChoiceDialog is a good way to go:

# exploring the wx.SingleChoiceDialog
# fish_list from:
# http://allrecipes.com/Recipes/Seafood/Fish/Main.aspx
# snee

import wx

class MyFrame(wx.Frame):
    def __init__(self, fish_list):
        wx.Frame.__init__(self, None, -1, 'wx.SingleChoiceDialog',
            size=(350, 100))
        self.CreateStatusBar()
        label = wx.StaticText(self)
        
        dlg = wx.SingleChoiceDialog(None,
            "What's your favorite fish to eat?",
            'Select a Fish', fish_list)
        if dlg.ShowModal() == wx.ID_OK:
            answer = dlg.GetStringSelection()
            # show the selected choice different ways ...
            sf = 'Your choice was: %s' % answer
            label.SetLabel(sf)
            self.SetStatusText(sf)
            self.SetTitle(sf)
        dlg.Destroy()

fish_list = [
'Catfish',
'Cod',
'Flounder',
'Haddock',
'Halibut',
'Mahi Mahi',
'Salmon',
'Snapper',
'Swordfish',
'Tilapia',
'Trout',
'Tuna'
]

app = wx.App()
frame = MyFrame(fish_list)
frame.Center()
frame.Show()
app.MainLoop()
sneekula 969 Nearly a Posting Maven

Here is an example how to do something like this with PIL:

# create an empty image with PIL and put pixels inside

from PIL import Image

# use a (r, g, b) tuple to represent colors
red = (255,0,0)
white = (255,255,255)

# create a new 256x256 pixel image surface
# make the background white (default bg=black)
img = Image.new("RGB", [256,256], white)

# keep y fixed to create a horizontal line
y = 10
for x in range(10, 100):
    # put a red pixel at point (x, y)
    img.putpixel((x, y), red)

# save the image
img.save("test1.png")

# optionally look at the image you have created
img.show()
sneekula 969 Nearly a Posting Maven
sneekula 969 Nearly a Posting Maven

Just a basic text editor written with the Tkinter GUI toolkit:

# a very simple Tkinter editor
# shows you how to create a menu and
# use the file dialog to read and write files of text data
# snee

try:
    # Python2
    import Tkinter as tk
    import tkFileDialog as tkfd
except ImportError:
    # Python3
    import tkinter as tk
    import tkinter.filedialog as tkfd

class MyEditor(object):
    def __init__(self, master):
        frame = tk.Frame(master)
        frame.pack()
        self.text = tk.Text(bg='white')
        self.text.pack()
        
        menu = tk.Menu(master)
        root.config(menu=menu)
        # file menu
        filemenu = tk.Menu(menu, tearoff=0)
        menu.add_cascade(label="File", menu=filemenu)
        filemenu.add_command(label="New", command=self.new_text)
        filemenu.add_command(label="Open", command=self.file_open)
        filemenu.add_command(label="SaveAs", command=self.file_saveas)
        filemenu.add_separator()
        filemenu.add_command(label="Exit", command=self.do_exit)
        
        # start with cursor in the editor area
        self.text.focus()
        
    def new_text(self):
        """clear the text area so you can start new text"""
        self.text.delete(0.0, 'end')
    
    def file_open(self):
        """open a file to read"""
        # the filetype mask (default is all files)
        mask = \
        [("Text and Python files","*.txt *.py *.pyw"),
        ("HTML files","*.htm *.html"),
        ("All files","*.*")]
        fin = tkfd.askopenfile(filetypes=mask, mode='r')
        text = fin.read()
        if text != None:
            # delete any old text first
            self.text.delete(0.0, 'end')
            self.text.insert('end', text)

    def file_saveas(self):
        """get a filename and save your text to it"""
        # default extension is optional, will add .txt if missing
        fout = tkfd.asksaveasfile(mode='w', defaultextension=".txt")
        text2save = str(self.text.get(0.0, 'end'))
        fout.write(text2save)
        fout.close()

    def do_exit(self):
        root.destroy()

root = tk.Tk()
# use width x height + x_offset + y_offset (no spaces!)
root.geometry("%dx%d+%d+%d" % (500, 300, 120, 80))
root.title("my very simple editor")
myed = MyEditor(root)
root.mainloop()

A nice template you make improvements on.

sneekula 969 Nearly a Posting Maven

Try this:
print(10^2)
print(10**2)

sneekula 969 Nearly a Posting Maven

The Tkinter drawing canvas can be fun. Here are two short programs that can be used by an artist for creative things:

# draw a circle with center (x, y) and fixed radius at
# each mouse (x, y) click point

try:
    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk

def draw_circle(event):
    '''
    draw a circle with given radius and its center
    at the mouse click position
    '''
    x = event.x
    y = event.y
    radius = 40
    # to draw a circle you need to get the upper left
    # and lower right corner coordinates of a square
    rect = get_square(x, y, radius)
    # draw the cicle that fits into the rect/square
    circle = cv.create_oval(rect)

def get_square(x, y, radius):
    '''
    given the center=(x, y) and radius
    calculate the square for a circle to fit into
    return x1, y1, x2, y2 of the square's ulc=(x1, y1) and
    lrc=(x2, y2) diagonal corner coordinates
    '''
    x1 = x - radius
    y1 = y - radius
    x2 = x + radius
    y2 = y + radius
    return x1, y1, x2, y2

# create the basic window, let's call it 'root'
root = tk.Tk()
# only set x=100, y=80 position of root upper left corner
root.geometry("+%d+%d" % (100, 80))
root.title("click the mouse on the green area")

# create a canvas to draw on
cv = tk.Canvas(root, width=600, height=600, bg='green')
# position the canvas
cv.grid()

# respond to the mouse as it is clicked
root.bind("<Button-1>", draw_circle)

# start the …
sneekula 969 Nearly a Posting Maven

If you have young children at home, or are yourself a young child at heart, there is a delightful Python module called frog, that does turtle like drawings and more:

# frog is a somewhat advanced turtle graphics module
# get frog-1.0.1.zip from:
# http://www.zahlenfreund.de/python/frog.html
# see also:
# http://pypi.python.org/pypi/frog/1.0.0
# unzip and copy frog.py into the Python lib folder
# or use it in the working folder
# works with Python2 and Python3

import frog

# pond forms the canvas
pond = frog.Pool()
pond.title = "Watch the frog move and draw"
pond.bgcolor = "lightblue"
# kermit forms the drawing pen
kermit = frog.Frog(pond)
kermit.shape = "frog"
kermit.bodycolor = "green"
# kermit draws a square 
# starts at the center of the pond
for n in range(4):
    kermit.move(100)
    kermit.turn(90)
# turn kermit in the other direction
kermit.turn(180)
for n in range(4):
    kermit.move(100)
    kermit.turn(90)
pond.ready()

Just a little more for the fun of it:

# get frog-1.0.1.zip from:
# http://www.zahlenfreund.de/python/frog.html
# unzip and copy frog.py into the Python lib folder
# or use it in the working folder
# works with Python2 and Python3

import frog

canvas = frog.Pool()
canvas.setbgcolor('green')
# use the default triangle shape
pen = frog.Frog(canvas)
pen.color = "red"
# pen normally starts in the canvas center
# make it jump (no drawing) left and then down
pen.jump(-50)
pen.turn(90)
pen.jump(-25)
pen.turn(270)
# the pen draws a number of 'pentagon shapes' 
# starts at the center and forms a star
for …
sneekula 969 Nearly a Posting Maven

How about a blank icon as a spacer? Or maybe just a label with a few spaces?

Stefano Mtangoo commented: Blank icon? Great Idea! +7
sneekula 969 Nearly a Posting Maven

Here is a short code that allows you to list all the files in a given directory and its subdirectories:

#!/usr/bin/env python2.5

# list all files in a directory tree using recursion
# shows full file paths of all files in subdirectories too
# works with Python2 and Python3

import os

def mylister(currdir, mylist=[]):
    """default mylist becomes static"""
    #print( "looking at %s" % currdir )  # test
    for file in os.listdir(currdir):
        # add directory to filename
        path = os.path.join(currdir, file)
        if not os.path.isdir(path):
            #print(path)  # test
            mylist.append(path)
        else:
            # recurse into subdirectories
            mylister(path)
    return mylist

# this allows the module mylister to be tested
if __name__ == '__main__':
    # pick a folder/directory
    # for Windows use something like this
    #folder = r"C:\Temp"
    # for Linux use something like this
    folder = "/home/dell/Documents"
    path_list = mylister(folder)
    for path in path_list:
        print(path)

"""my partial result -->
/home/dell/Documents/about.html
/home/dell/Documents/_sources/user/basics.rec.txt
/home/dell/Documents/_sources/user/performance.txt
/home/dell/Documents/_sources/user/basics.indexing.txt
/home/dell/Documents/_sources/user/basics.txt
/home/dell/Documents/_sources/user/basics.creation.txt
/home/dell/Documents/_sources/user/misc.txt
/home/dell/Documents/_sources/user/index.txt
...
"""

Change the code in such a manner that, for instance, only image files are listed. Image files would have extensions like .jpg .png .gif .bmp an so on.

sneekula 969 Nearly a Posting Maven

Something like ...

toolbar.AddSimpleTool(wx.ID_SAVE, self.getBMP(wx.ART_FILE_SAVE),
            "Save", " Save the text file")

... shows you the text "Save" as a popup hint

sneekula 969 Nearly a Posting Maven

I don't understand how you go from :
(4, 22, 51): 3
to:
4 22 7 51

sneekula 969 Nearly a Posting Maven

You are way ahead of me on this. Looks like a very interesting project!
What are you using to control the motor with the serial port?

sneekula 969 Nearly a Posting Maven

I don't understand what you are asking for. Could you explain, maybe give a short example?

sneekula 969 Nearly a Posting Maven

Sometimes a few test prints are a real eye opener:

test = [[11,22,33,44,55,66]]

print(test[0])     # [11, 22, 33, 44, 55, 66]
print(test[0][0])  # 11
print(test[0][1])  # 22
sneekula 969 Nearly a Posting Maven

PMW has not been updated since 2007. Do you really want to go with this stale old thing?