Python Forum
[WxPython] Process finished with exit code
Thread Rating:
  • 3 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[WxPython] Process finished with exit code
#1
Not sure what is wrong. I am using PyCharm and it shows no errors. But when I run it I get: Process finished with exit code -1073741571 (0xC00000FD)

import wx
import wx.xrc


class MyApp(wx.App):
    def OnInit(self):
        self.frame = MyFrame(None)
        self.SetTopWindow(self.frame)
        self.frame.Show()
        return True


class MyFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"My List", pos=wx.DefaultPosition, size=wx.Size(500, 400),
                          style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
        self.SetBackgroundColour(wx.Colour(0, 128, 128))

        myFlexGridSizer = wx.FlexGridSizer(1, 1, 0, 0)
        myFlexGridSizer.SetFlexibleDirection(wx.BOTH)
        myFlexGridSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)

        myBoxGridSizer = wx.BoxSizer(wx.VERTICAL)

        self.headerLabel = wx.StaticText(self, wx.ID_ANY, u"Glucose", wx.Point(-1, -1), wx.DefaultSize, 0)

        self.headerLabel.Wrap(-1)
        self.headerLabel.SetFont(wx.Font(wx.NORMAL_FONT.GetPointSize(), 75, 90, 92, True, wx.EmptyString))

        myBoxGridSizer.Add(self.headerLabel, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 5)

        mListBoxChoices = [u"Update Data", u"A1c", u"Exit"]
        self.mListBox = wx.ListBox(self, wx.ID_ANY, wx.Point(-1, -1), wx.Size(300, 300), mListBoxChoices, wx.LB_SINGLE)
        self.mListBox.SetFont(wx.Font(12, 75, 90, 90, False, wx.EmptyString))

        myBoxGridSizer.Add(self.mListBox, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)

        myFlexGridSizer.Add(myFlexGridSizer, 1, wx.EXPAND, 5)

        self.SetSizer(myFlexGridSizer)
        self.Layout()
        self.Centre(wx.BOTH)

        self.mListBox.Bind(wx.EVT_LISTBOX, self.showSelectedItem)

    def __del__(self):
        pass

    def showSelectedItem(self, event):
        wx.MessageBox(event.GetEventObject().GetStringSelection(), "Selected")


app = MyApp(False)
MyFrame.Show()
app.MainLoop()
Being new to python I tried to find the answer but nothing fit to my problem.
Gary
Reply
#2
What happens if you remove line 56? Your app already creates and shows the frame, so showing it again (and without a root object) seems odd.
Reply
#3
It could be a PyCharm issue, does it occur if you run the code in an ordinary terminal out of PyCharm?
Reply
#4
Yes, it does.

But I redid the coded so it was more up to date with Python 3.7 and everything now works fine

Thank you
Gary
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter Exit Code based on Entry Widget Nu2Python 6 369 Oct-21-2021, 03:01 PM
Last Post: Nu2Python
  [WxPython] Process finished with exit code -1073741819 (0xC0000005) Kangaroo 4 1,581 Apr-06-2020, 05:43 PM
Last Post: Kangaroo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020