woooee 814 Nearly a Posting Maven

Tested "print type(idrow)" and it says <type 'unicode'>

Here the schema of my table:

id : integer primary key autoincrement

So idrow has to be converted to an integer. Hopefully you can see why. Also, are you using Python 3.X?

try:
    idrow_int = int(idrow)
    self.cur.execute("select titre, code, date from codes where id=:d_key", {"d_key":idrow_int})
    ## etc.
except:
    print idrow, "can not be converted to an integer"
woooee 814 Nearly a Posting Maven

This just says that there is no column in the DB named "a.sequence". There is no way to tell any more from a single line of code.

woooee 814 Nearly a Posting Maven

Traceback (most recent call last):
File "/home/steph/scripts/phpy/main.py", line 191, in OnListboxread
res = self.dbUse.readRow(getidrow)
File "/home/steph/scripts/phpy/bdd.py", line 37, in readRow
getRow = "// " + ligne[0] + " " + ligne[2] + "\n\n" + ligne[1]
TypeError: 'NoneType' object is unsubscriptable

No record was found. You have to test for "None". See below.

Clearly the issue comes from the idrow.

If i replace idrow by a value i define there is no error, for example like that:
Python Syntax (Toggle Plain Text)
self.c.execute("select titre, code, date from codes where id = 50")

"50" is a string in this case. Is the variable an integer? You didn't post the DB definition so we have no idea what type of object is in the DB.

def read_row(self, idrow):

        ##----- converting to string
        self.cur.execute("select titre, code, date from codes where id=:d_key", {"d_key":str(idrow)})
        found = self.cur.fetchone()
        if found is None:
            print "result is None=no recs found"
        else:
            for field in found:
                print "     ", field 
        return whatever
woooee 814 Nearly a Posting Maven

Note also that you should not be creating a new cursor every time this function is executed.

class SQLTest:
    def __init__(self):
        self.con = sqlite.connect(table_name )
        self.cur = self.con.cursor()
   
        ##--- ONLY CREATE FIRST TIME
        self.cur.execute("CREATE TABLE IF NOT EXISTS...etc"

        read_value = self.read_row(idrow)

    def read_row(self, idrow):
        self.cur.execute("select titre, code, date from codes where id=:d_key", {"d_key":idrow})
        found = self.cur.fetchall()
        if found is None:
            print "result is None=no recs found"
        else:
            print "type found", type(found)
            print "len", len(found)
            for rec in found:
                print rec
                for field in rec:
                    print "     ", field 
        return whatever
woooee 814 Nearly a Posting Maven

You have to fetch the records, fetchall or fetchone. Fetchall returns a list of tuples, fetchone returns a tuple.

c.execute("select titre, code, date from codes where id=:d_key", {"d_key":idrow})
found = c.fetchall()
print "type found", type(found)
print "len", len(found)
for rec in found:
    print rec
    for field in rec:
        print "     ", field

Post back with a simple, complete program if this doesn't work as SQLite is pretty straight forward.

woooee 814 Nearly a Posting Maven

To be complete, Linux requires style=wx.TE_PROCESS_ENTER

import wx
 
class MyFrame(wx.Frame):
    def __init__(self, parent, mytitle, mysize):
        wx.Frame.__init__(self, parent, -1, mytitle, size=mysize)
        self.SetBackgroundColour("white")
        s = "Enter the price:"
        label = wx.StaticText(self, -1, s, pos=(10,10),)
        self.edit = wx.TextCtrl(self, -1, pos=(10, 30), \
                                size=(100, 25), style=wx.TE_PROCESS_ENTER)
        # respond to enter key when focus is on edit
        self.edit.Bind(wx.EVT_TEXT_ENTER, self.onAction)
        self.edit.SetFocus()
         
    def onAction(self, event):
        """
        check for numeric entry and limit to 2 decimals
        accepted result is in self.value
        """
        raw_value = self.edit.GetValue().strip()
        print raw_value
        # numeric check
        if all(x in '0123456789.+-' for x in raw_value):
            # convert to float and limit to 2 decimals
            self.value = round(float(raw_value), 2)
            self.edit.ChangeValue("%9.2f" % (self.value))
        else:
            self.edit.ChangeValue("Number only")
 
 
app = wx.App(0)
# create a MyFrame instance and show the frame
mytitle = 'Numeric entry test'
width = 450
height = 200
MyFrame(None, mytitle, (width, height)).Show()
app.MainLoop()
woooee 814 Nearly a Posting Maven

You should use a dictionary for all queries, deletes, etc. %s opens the DB to SQL injection.

c.execute("select titre, code, date from codes where id=:d_key", {"d_key":idrow})
x=cur.fetchall()
#
# multiple select fields
c.execute("select titre, code, date from codes where id=:d_key and col=:d_col", {"d_key":idrow, "d_col":column_var})
#
c.execute("delete from codes where id=:d_key", {"d_key":idrow})
con.commit())
#
#etc.
woooee 814 Nearly a Posting Maven

You are obviously not passing the ball object to Bounce (Python naming conventions), so look at the places that call Bounce and see if the ball object is actually being passed.

woooee 814 Nearly a Posting Maven

That is one extra copy, but only matters if there is a lot of data.

if 'RecCount' in row:
        new_row = row.replace('RecCount','12345')
        output.write(new_row)
    else:
        output.write(row)
woooee 814 Nearly a Posting Maven

"row" is a string, and strings are immutable, i.e. can not be changed, so you have to catch the return and use it.

for row in open('C:\\test.xml','r'):
    if 'RecCount' in row:
        print row
        new_row = row.replace('RecCount','12345')
        print new_row
woooee 814 Nearly a Posting Maven

You would first compare the ID returned to record[0], the original ID. If it has changed, you can use UPDATE

cur.execute("UPDATE People SET SQL_id_tag==:update_id",
       {"update_id": new_id_variable})
con.commit()
woooee 814 Nearly a Posting Maven

We usually get the palindrome homework questions earlier in the year. To solve your problem, add some print statements at the very least:

s=input("Enter alphabetic characters: ")
def palindrome(s):
    index=0
    c=True
    while index<len(s):
        print "comparing", s[index], s[-1-index], "for index", index
        if s[index]==s[-1-index]:
            index +=1
            print "returning True"
            return True
        print "returning False"
        return False
if palindrome(s)==True:
    print ("This is alphabetic characters")
else:
    print ("This is not alphabetic characters")
woooee 814 Nearly a Posting Maven

Test the code you have before posting it here. For example, in the Deck class, there is an indentation error, and the variable "c" [c = Card(rank, suit)] is an instance of the class Card. To access the rank and suit from the Deck class, you would use
self._cards[ctr].rank and self._cards[ctr].suit
where ctr = a number between 0 through 51. Is this what you want? Also,
if len(self) == 0:
should error because "self" is a pointer to this class and has no length.

To answer your question directly, if all cards are the same suit as the first card, it is a flush. If the hand is sorted in numerical order and each card = previous card +1 then you have a straight. For now though, get the code you have working (print the deck after it is created and the hands after they are dealt at the very least). Note that you can also use a dictionary for changing the numbers to J, Q, K, or A. Also, you would possibly use a dictionary to store the relative value of the different hands so you know which hand wins.

rank_dict = {11: 'J',
             12: 'Q',
             13: 'K',
             14: 'A' }

## test dictionary use
rank = [2, 12]
for r in rank:
    print r,
    if r in rank_dict:
        print rank_dict[r]
    else:
        print r
"""
    The dictionary replaces the following code

    if self.rank == 11:
      rank = 'J'
    elif self.rank == 12:
      rank …
woooee 814 Nearly a Posting Maven

You do not return the amount from getInput (Python naming conventions) so you have no amount to work with. Also, one function will suffice for deposits and withdrawals. This is an example only.

def deposit_withdrawal(this_task, amount, balance):
    if this_task == "d":
        return balance + amount
    else:
        return balance - amount
       
def get_input(balance):
    account number = input(“Enter your account number:”)
    print("Account Balance is: ", balance)
       
    next_task = ""
    while next_task not in ["d", "w"]:
        print(“\nEnter your choice of task.”)
        next_task = input(":'D' to make a deposit:, 'W' to make a withdraw: "
        next_task = next_task.lower()
        amount = float(input("Enter amount:")
    return nextTask, amount
       
if __name__ == "__main__":
    balance = 110.01
    more = "y"
    while more == “y”:
        print(“Do you want another transaction?”)
        more = input(“Enter Y or N: ”)
        more = more.lower()
       
        task_to_do, amount = get_input(balance)
        balance = deposit_withdraw(task_to_do, amount, balance)

    input(“\n\nPress the Enter key to exit”)
woooee 814 Nearly a Posting Maven

Split on the comma and test for length. If the length is one, then a total was entered, otherwise it is a series of numbers. One alternative is to use easygui, with one box for the total and a second entry box for individual numbers, so which ever box has an entry (length) is the function you choose.

woooee 814 Nearly a Posting Maven

A suggestion:

if guess == "":
            print "Good-bye!"
            ##break
            return  ## exit play() function
        elif (guess == hint) and (word1 in hints):
            print hints[word1]

        """
            if word1 == 'python':
                print hints["python"]
            elif word1 == 'jumble':
                print hints["jumble"]
            elif word1 == 'easy':
                print hints["easy"]
            elif word1 == 'difficult':
                print hints["difficult"]
            elif word1 == 'answer':
                print hints["answer"]
            elif word1 == 'xylophone':
                print hints["xylophone"]

            continue
        """ 
#
        while (guess != correct) and (guess != "") and (guess != 'hint'):
# replace with
        while guess not in [correct, "", 'hint']:
woooee 814 Nearly a Posting Maven

Damn, if only I'd known this a week ago I'd have a closet full of candy. It could have been 8,000,001.

"(Reuters) - Eight million Americans admit they send themselves Valentine's Day
gifts."

And, switch to yellow. Colors mean what you want them to mean.
"Saudi Arabia has banned red roses ahead of Valentine's Day, forcing couples in the conservative Muslim nation to think of new ways to show their love.

The Commission for the Promotion of Virtue and Prevention of Vice ordered florists and gift shop owners in the capital Riyadh to remove any items colored scarlet which is widely seen as symbolizing love."

woooee 814 Nearly a Posting Maven

Should you be using "the_word", since that is what is returned from random_word()?

woooee 814 Nearly a Posting Maven

Read "Basics"in this page especially the use of a for() statement, for some help with using lists. shutil's copytree may or may not work as well.

woooee 814 Nearly a Posting Maven

You might want to consider 2 sets, as the logic may be easier to understand.
key_set = your current keys
value_set = your current values, each one added as an individual item

for key in key_set:     ## there are fewer keys than values
    if key in value_set:
        print key, "found"
#
# or
print key_set.intersection(value_set)
woooee 814 Nearly a Posting Maven

Print projData, and type(projData) to see what it is. Read "Basics"in this page especially the use of a for() statement, for some help with using lists. Python naming conventions/style guide.

woooee 814 Nearly a Posting Maven

The errors I receive:
shutil.copy(files, dest)

Print "files" and "dest" somewhere in the program, also type(files), type(dest);

TypeError: cannot concatenate 'str' and 'list' objects

to see which is not a string

woooee 814 Nearly a Posting Maven
if timeholder != time:

This will always be true on the first pass as timeholder is a string and time is a builtin class/module. Print type(time) and type(timeholder) to show this.

timeholder = time

This statement then copies the time class to timeholder, so the two will always be equal on subsequent passes, i.e. the same class/module. You possibly want time.time() or datetime.datetime.now(). Also, the indentation is off by one, which I assume is from the error in using a combination of tabs and spaces, instead of spaces only (which is preferred).

woooee 814 Nearly a Posting Maven

You should be getting an error in the sumsDivs() function because you return the variable "sum" which is never declared or defined, and is a reserved word so should not be used as a variable name. Also, you call sumsDivs(number), but never change the value of number within the while() loop, so you are always testing the same number. You should explain what a perfect number is, for anyone reading this who doesn't know.

woooee 814 Nearly a Posting Maven

Print sql_key and that should provide some insight. You are creating a string, and not querying an SQL database, so string formatting is required. The following assumes that all fields are strings and not integers or floats.

sql_key = "select company_name, param_key,com_value from key_financial_ratio                 where param_key = %s and com_value > %s and com_value < %s" % (paramKey,startValue,endValue)
print sql_key

This is somewhat dependent on which flavor of SQL you are using, and which version of Python you have installed, so once again print the string, and see if it is what you expect. Note that the string can, and probably should be divided into multiple, shorter segments for easier reading. If this doesn't work as expected, post back with some samples.

woooee 814 Nearly a Posting Maven

I doubt anyone is familiar with cslgraphics, and would not have it installed. You will have to provide more info about the cslgraphics package. Also "Please help me with, creating an checker board" is way too vague to respond to.

woooee 814 Nearly a Posting Maven

You have two different file pointers to the same file, one for reading and one for writing (and you open it again on every pass through the while() loop). The results are unpredictable for a situation like that. Read the file into memory and then close the file. You can then open it for writing/appending. Also, code like this should be cleaned up and functions should be outside of the while() loop in which case the function would not know what iErrors is (Python naming conventions). Some info on Function parameters.

def DrawErrors():
 
        if iErrors == 0:
            print HangingMan[0]
        elif iErrors == 1:
            print HangingMan[1]
        elif iErrors == 2:
            print HangingMan[2]
        elif iErrors == 3:
            print HangingMan[3]
        elif iErrors == 4:
            print HangingMan[4]
        elif iErrors == 5:
            print HangingMan[5]
        elif iErrors == 6:
            print HangingMan[6]
        elif iErrors == 7:
            print HangingMan[7]
        elif iErrors == 8:
            print HangingMan[8]
##
##-----------  replace with -------------------------------------
def draw_errors(i_errors, hanging_man):
    if 0 <= i_errors <= 8:
        print hanging_man[i_errors]
    else:
        print "Non-legal value for i_errors =", i_errors
woooee 814 Nearly a Posting Maven

If you can not use a built-in method to reverse the string (or list if you prefer), please state what the requirements are, otherwise:
reverse_word = input_word[::-1] ## [begin:end:step=-1]

woooee 814 Nearly a Posting Maven

You would also have to test for the length of each item:

db = [["a", "b", "c"], ["apple", "bean", "cat"], ['d', 'e', 'f']]
for each_list in db:
    output_list = []
    for item in each_list:
        if len(item) > 1:
            print item
        else:
            output_list.append(item)
    if len(output_list):
        print "".join(output_list)
woooee 814 Nearly a Posting Maven

i=i+b;
This will give you the sum of the digits. Add some print statements so you know what is going on.

woooee 814 Nearly a Posting Maven

Take a look at the "Starting Python" sticky at the top of this forum. There are many resources, including the Google (free) online course.

vegaseat commented: worth it +13
woooee 814 Nearly a Posting Maven
subprocess.call(['python link_config_idu12.py %s'%addr],shell=True)

"addr" is not defined in the code you posted.

But, i see that what i expect is not happening.

What does this mean? To set a list element, you access by the offset, i.e

test_list = [0, 0, 0, 0]
print "Before", test_list
for y in range(5):
    test_list[y] = y
print "After", test_list
woooee 814 Nearly a Posting Maven

Is there something I am doing wrong?

There is no way to tell what you are doing. You didn't post any code to comment on. Take a look at vegaseat's example here and see if it helps you.

woooee 814 Nearly a Posting Maven

This is a linked list type of problem, where every question is linked to another for a yes or no response. Each question is assigned a unique number. It does not matter what the number is, it is just a unique identifier for each question. So you can have multiple questions linked to "bigger than a backpack" for example. A simple snippet follows. At some point you will have to guess, so you might want to also be able to input "guess" at any point, and guess in some way.

##         layout =  question        yes  no
question_dic = {1: ("Is it a thing? ", 21, 11), 
                11: ("Is it a place? ", 21, 12),
                12: ("Is it a person? ", 21, 21),
                21: ("Can it fit in a backpack? ", 0, 22),
                22 ("Is it bigger than a car? ", 23, 24),
                23: ("Is it bigger than a house? ", 0, 0),
                24: ("Is it bigger than a table? ", 0, 0)}

store_responses = {}
num = 1
while num != 0:
    question = question_dic[num][0]
    x = ""
    lit = ""
    while x not in ("yes", "no"):
        print lit
        x = raw_input(question).lower()
        lit = "Enter 'Yes' or 'No' only"

    store_responses[num]= x              ## question number & yes or no
    if x == "yes":
        num = question_dic[response][1]
    else:   
        num = question_dic[response][2]

print "Game Over"
woooee 814 Nearly a Posting Maven

Start by getting the file name, opening it, and reading it one record at a time http://diveintopython.org/file_handling/file_objects.html. Split each line into words and use a dictionary http://diveintopython.org/native_data_types/index.html#odbchelper.dict to store each unique word. Once that is done, add a routine to use this dictionary to count the number of times the word appears. Don't worry about which line it appears on right now. First post the code for the above and then ask for help with the remainder.

woooee 814 Nearly a Posting Maven

Use split and then join:

s = "abc def   ghi     jkl"
split_s = s.split()
print "\t".join(split_s)
woooee 814 Nearly a Posting Maven

Also, calculate (p0 * math.e) once before the for() instead of every pass calculating it again. You should be using one for() loop, since they all do the same thing.

numeratorPos1 = 0
numeratorPos2 = 0
denominatorPos = 0
p0_math_e = p0 * math.e
for x in range(0, n):        
    y = p0_math_e**(-(decay * x))

    numeratorPos += ((x**2)*y)
    numeratorPos += (y*(math.log(y)))
    denominatorPos += y
#
# etc.
woooee 814 Nearly a Posting Maven

This will produce a unique number for each file name.

for ctr, fname in enumerate(files):
    print ctr, fname
woooee 814 Nearly a Posting Maven

Since you have 2 panels, the button should go in one of them. Container widgets are there for a reason. Once again, take a look at Lardmeister's code, especially how the panel container is used

woooee 814 Nearly a Posting Maven

Use a function for the redundant code. An example only to replace plant, predator, and prey append redundancy:

def append_next(item, list_in, max_depth):

    ## first 3 values not used
    gauss_list = [0, 0, 0, 10, 0.5, 0.5, 0.5, 0.5]
    if item[2]>item[3]:#this path spawns another
            next_item = deepcopy(item)
            list_in.append(next_item)#the baby is spawned
            list_in[-2][2]=list_in[-2][2]/2#halves size of old plant
            list_in[-1][2]=list_in[-1][2]/2#halves size of new plant

            list_in[-1][0]= list_in[-1][0]+random.gauss(0.0,list_in[-1][4])#changes x coordinate
            list_in[-1][1]= list_in[-1][1]+random.gauss(0.0,list_in[-1][4])#changes y coordinate

            for x in range(max_depth+1):
                amt = gauss_list[x]:
                list_in[-1][x] += random.gauss(0,amt)
    return list_in
#
#------------------------------------------------------------------------------------
        if plant[2]>plant[3]:#this path spawns another plant
            Nplants = append_next(plant, Nplants, 4):
#
#------------------------------------------------------------------------------------
        if prey[2]>prey[3]:#this path spawns another prey
            Nprey = append_next(prey, Nprey, 8): 
#
# etc. for predators
woooee 814 Nearly a Posting Maven

The Lardmeister submitted this example in the "Starting wxPython" sticky which I think does something similar to what you want.

# a simple mortgage calulator using wxPython
# checked it out with the online mortgage calculator at:
# http://www.mortgage-calc.com/mortgage/simple.php
 
import wx
import math
 
class MyFrame(wx.Frame):
    """frame and widgets to handle input and output of mortgage calc"""
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)
        # add panel, labels, text and sizer widgets
        panel = wx.Panel(self, -1)
        panel.SetBackgroundColour('green')
        label1 = wx.StaticText(panel, -1, "Enter total loan amount:")
        label2 = wx.StaticText(panel, -1, "Enter annual interest (%):")
        label3 = wx.StaticText(panel, -1, "Enter years to pay:")
        self.loan = wx.TextCtrl(panel, -1, "100000")
        self.interest = wx.TextCtrl(panel, -1, "6.5")
        self.years = wx.TextCtrl(panel, -1, "30")
        self.calc_btn = wx.Button(panel, -1, ' Perform Mortgage Calculation ')
        self.calc_btn.SetBackgroundColour('light blue')
        self.calc_btn.Bind(wx.EVT_BUTTON, self.onCalc)
        info = "Modify the above data to your needs!"
        self.result = wx.TextCtrl(panel, -1, info, size=(290, 100), 
            style=wx.TE_MULTILINE)
 
        # use gridbagsizer for layout of widgets
        sizer = wx.GridBagSizer(vgap=5, hgap=10)
        sizer.Add(label1, pos=(0, 0))
        sizer.Add(self.loan, pos=(0, 1))  # row 0, column 1
        sizer.Add(label2, pos=(1, 0))
        sizer.Add(self.interest, pos=(1, 1))
        sizer.Add(label3, pos=(2, 0))
        sizer.Add(self.years, pos=(2, 1))
        sizer.Add(self.calc_btn, pos=(3, 0), span=(1, 2))
        # span=(1, 2) --> allow to span over 2 columns 
        sizer.Add(self.result, pos=(4, 0), span=(1, 2))
 
        # use boxsizer to add border around sizer
        border = wx.BoxSizer()
        border.Add(sizer, 0, wx.ALL, 20)
        panel.SetSizerAndFit(border)
        self.Fit()
 
    def onCalc(self, event):
        """do the mortgage calcuations"""
        # get the values from the input widgets
        principal = float(self.loan.GetValue())
        interest = float(self.interest.GetValue())
        years = float(self.years.GetValue())
        # calculate        
        interestRate …
woooee 814 Nearly a Posting Maven

Usually that means that two items point to the same memory address, but without knowing more about "plant" (whether it is a string, list, etc.), and the same for Nplant (a list or list of lists?), there is no way to tell. Insert this code after appending, which prints the id, and see if 2 or more id's are the same.

for pl in Nplants:
    print id(pl)

For more help, post a complete code snippet, that will run as is, and some sample data to use for appending.

woooee 814 Nearly a Posting Maven

You are coding the button callback incorrectly. When you produce 102 lines of code with no testing, it is very difficult to find which line is segfaulting amongst all that code. Apparently no one else wanted to sift through all of this either. For starters, break this up using functions so you can test each function individually. The variables "RESOLUTION" and "CARRIERS" have not been declared in this class, so you will get an error. Note that the following program runs, but obviously still requires some work.

import wx

class EnterEmail(wx.Frame):
    def __init__(self, parent,id,title):
##        wx.Frame.__init__(self,parent,id,title,size=(RESOLUTION[0]/1.5,RESOLUTION[1]/1.5))
        wx.Frame.__init__(self,parent,id,title)
        self.parent=parent
        font5 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL)
        font3 = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL)
        font1 = wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD,True)
        self.SetBackgroundColour('#f2f200')
 
 
        sizer=wx.BoxSizer(wx.VERTICAL)
        panel0=wx.Panel(self,-1)

        infoLabel = wx.StaticText(panel0, -1, "Enter your phone and/or email information.")
        infoLabel.SetFont(font3)
 
        """
        panel1=wx.Panel(self,-1)
        hsizer=wx.BoxSizer(wx.HORIZONTAL)
        vsizer=wx.BoxSizer(wx.VERTICAL)
        vsizer2=wx.BoxSizer(wx.VERTICAL)
 
        emailLabel=wx.StaticText(self,-1,"Email")
        emailLabel.SetFont(font1)

        emailBoxLabel=wx.StaticText(self,-1,"Enter your e-mail address:")
        emailBoxLabel.SetFont(font5)

        self.email = wx.TextCtrl(self, -1, size=(300, 30))
        self.email.SetFont(font3)
 
        emailBoxLabel2=wx.StaticText(self,-1,"Confirm e-mail address:")
        emailBoxLabel2.SetFont(font5)
        self.confirmEmail = wx.TextCtrl(self, -1, size=(300, 30))
        self.confirmEmail.SetFont(font3)
 
        phoneLabel=wx.StaticText(self,-1,"Phone")
        phoneLabel.SetFont(font1)
 
        carrierLabel=wx.StaticText(self,-1,"Please select your service provider:")
        carrierLabel.SetFont(font5)
        self.carrierChoice=wx.Choice(self,-1,size=(300,30))
        self.carrierChoice.SetFont(font3)
        CARRIERS = ["abc", "def", "hij"]
        self.carrierChoice.AppendItems(strings=CARRIERS)
 
        numberLabel=wx.StaticText(self,-1,"Enter your phone number:")
        numberLabel.SetFont(font5)
        self.number= wx.TextCtrl(self, -1, size=(300, 30))
        self.number.SetFont(font3)
        """ 
        self.sendButton=wx.Button(panel0, -1,"Send", (30,30))
        self.sendButton.Bind(wx.EVT_BUTTON, self.OnSubmit)
        """ 
        self.startOverBut=wx.Button(self,-1,"Cancel",size=(150,30))
        self.Bind(wx.EVT_BUTTON,self.OnClose,self.startOverBut)
 
        #hooking it all together
        vsizer.Add(emailLabel,0,wx.TOP|wx.ALIGN_CENTER,5)
        vsizer.Add(emailBoxLabel,0,wx.TOP|wx.ALIGN_CENTER,25)
        vsizer.Add(self.email,0,wx.TOP|wx.ALIGN_CENTER,10)
        vsizer.Add(emailBoxLabel2,0,wx.TOP|wx.ALIGN_CENTER,25)
        vsizer.Add(self.confirmEmail,0,wx.TOP|wx.ALIGN_CENTER,10)
 
        vsizer2.Add(phoneLabel,0,wx.TOP|wx.ALIGN_CENTER,5)
        vsizer2.Add(carrierLabel,0,wx.TOP|wx.ALIGN_CENTER,25)
        vsizer2.Add(self.carrierChoice,0,wx.TOP|wx.ALIGN_CENTER,10)
        vsizer2.Add(numberLabel,0,wx.TOP|wx.ALIGN_CENTER,25)
        vsizer2.Add(self.number,0,wx.TOP|wx.ALIGN_CENTER,10)
 
        vsizer.Add(self.startOverBut,0,wx.TOP|wx.EXPAND,25)
        vsizer2.Add(self.sendButton,0,wx.TOP|wx.EXPAND,25)
 
        sizer.Add(infoLabel, 0, wx.TOP|wx.ALIGN_CENTER, 5)
        panel0.SetSizer(vsizer)
        panel1.SetSizer(vsizer2)
        hsizer.Add(vsizer,0,wx.LEFT|wx.ALIGN_LEFT,5)
        hsizer.Add(vsizer2,0,wx.LEFT|wx.ALIGN_RIGHT,5)
 
 
 
        sizer.Add(hsizer)
        self.SetSizer(sizer)
 
        self.Centre()
        self.Bind(wx.EVT_TIMER, self.OnUpdateTimer)
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow())
        """

        self.Show(True)
        print 'done '

    def OnSubmit(self,event):
        print "OnSubmit called"

    def OnUpdateTimer(self,evt):
        pass

    def OnClose(self):
####        self.email.Destroy()
####        self.confirmEmail.Destroy()
####        self.carrierChoice.Destroy()
#### …
woooee 814 Nearly a Posting Maven

See examples for pickle here. Pickle stores Python objects, like a dictionary. In order to load a pickle file, you first have to dump it in pickle format. So, first check that the file exists. Other than that, I have no idea what " need help in the open function" means.

woooee 814 Nearly a Posting Maven

self.itemEvens will contain the object for the last button created in the for() loop. Instead, store each individual button object in a dictionary or list. You can then delete whichever button object you choose.

woooee 814 Nearly a Posting Maven

is that the part telling the grid manager to expand the widget downward instead of writing text on top of itself?

Yes.

woooee 814 Nearly a Posting Maven

It is not clear whether you want to run a Python program that will populate icons which will then run other Python programs as subprocesses of the main program, or you want to launch desktops apps with the icon and use Python to generate those icons for some reason. Why do you have to use icons? Would a simple button layout that would launch programs work just a well? If so, what GUI toolkits are you familiar with. A small snippet of code would help.

woooee 814 Nearly a Posting Maven

It possibly has something to do with the unconventional way you are including/calling Tkinter. The standard way is here. The following code works on my Slackware Linux system.

import Tkinter

class App():
    def __init__(self):
        self.parent = Tkinter.Tk()
        self.initialize() 
        self.parent.mainloop()
 
    def initialize(self):
        self.itemVar = "abc"
        for r in range(8):
            mode = r*2+1
            self.itemOdds =  Tkinter.Radiobutton(self.parent, text="item"+str(mode),
                        variable=self.itemVar, value=mode)
            self.itemOdds.grid(row=r, column=0)
 
        EVENS = [
            ('item0', 0),
            ('item2', 2),
            ('item4', 4),
            ('item6', 6),
            ('item8', 8),
            ('item10', 10),
            ('item12', 12),
            ('item14', 14),
        ]
 
        r = 0
        for text, mode in EVENS:
            self.itemEvens = Tkinter.Radiobutton(self.parent, text=text,
                        variable=self.itemVar, value=mode)
            self.itemEvens.grid(row =r, column=1)
            r += 1

if __name__ == "__main__":
    app = App()
woooee 814 Nearly a Posting Maven

You should supply both the row and column to the grid http://effbot.org/tkinterbook/grid.htm

woooee 814 Nearly a Posting Maven

We don't know which GUI toolkit is being used and the OP hasn't responded for 6 days, so this thread is dead.