Understanding pdb result

Rich Shepard rshepard at appl-ecosys.com
Sat Apr 28 10:40:12 EDT 2018


On Fri, 27 Apr 2018, Steven D'Aprano wrote:

> What error are you referring to?

Steven,

   The menu does not display, only the frame and status bar.

> Why are you using pdb in the first place?

   Because it is a debugger that allows me to process code line-by-line and
works with Python3.

> If you're getting an error, the first thing to do is read the traceback.
> If you're getting a traceback, tell us what it is. Don't paraphrase it,
> copy and paste it.

   There is no traceback. Had there been I would have been able to find the
problem.

> If you're not getting a traceback, please explain why you think you need
> to use pdb and what error you think you are getting, because I have no
> clue.

   See attached test.py.

Rich
-------------- next part --------------
#!/usr/bin/env python3

import wx

#!/usr/bin/env python3

import sys, os, importlib
import pdb
import wx
import wx.grid
import sqlalchemy

class MainFrame(wx.Frame):
    def __init__(self, parent, title='test'):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title = title,
                          size=wx.Size(800,600), style=wx.DEFAULT_FRAME_STYLE)
        
        self.SetSizeHints(minSize=wx.Size(300,200), maxSize=wx.Size(900,700),
                          incSize=wx.Size(50,50))

        # Create status bar
        self.CreateStatusBar()
        self.SetStatusText("This is where you'll see helpful messages")

        # Prepare the menu bar
        menuBar = wx.MenuBar()

        # 1st menu from left (File)
        fileMenu = wx.Menu()
        fileMenu.Append(wx.ID_NEW, '&New', 'Create new file')
        fileMenu.Append(wx.ID_OPEN, '&Open', 'Open existing file')
        fileMenu.Append(wx.ID_SAVE, '&Save', 'Save this file')
        fileMenu.Append(wx.ID_SAVEAS, 'S&ave as ...', 'Save file with different name')
        fileMenu.Append(105, '&Import', 'Import a file')
        fileMenu.Append(106, '&Export', 'Export this file')
        fileMenu.Append(wx.ID_CLOSE, '&Quit', 'Quit')
        # Add menu to menu bar
        menuBar.Append(fileMenu, '&File')

        
if __name__ == '__main__':
    edms = wx.App()
    top = MainFrame(None, 'test')
    top.Show()
    edms.MainLoop()


More information about the Python-list mailing list