Encountering Error Code 139 on WxPython when Opening Form Window

I'm encountering a frustrating issue with my program - it keeps crashing with exit code 139. From what I've gathered, this error is related to memory management. However, considering that the program is quite basic and runs smoothly on a similar setup, I'm puzzled as to why it's struggling on a 64-bit machine with 16GB of RAM. There's another class that mirrors this one closely and it performs without any hiccups. What could be causing this unexpected behavior?

import wx

class mainForm(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, title="Test")
        self.panel = wx.Panel(self)

        vbox_main = wx.BoxSizer(wx.VERTICAL)  # main vertical box

        url_box = wx.BoxSizer(wx.HORIZONTAL)
        url_label = wx.StaticText(self.panel, label="URL:")
        self.url_entry = wx.TextCtrl(self.panel)

        url_box.Add(url_box)
        url_box.Add(url_label)
        url_box.Add(self.url_entry)

        file_box = wx.BoxSizer(wx.HORIZONTAL)
        file_label = wx.StaticText(self.panel, label="File")
        self.file_entry = wx.TextCtrl(self.panel)
        file_button = wx.Button(self.panel, label="Search")
        file_button.Bind(wx.EVT_BUTTON, self.search)

        file_box.Add(file_label)
        file_box.Add(self.file_entry)
        file_box.Add(file_button)

        mode_box=wx.BoxSizer(wx.HORIZONTAL)
        mode_label=wx.StaticText(self.panel, label='Mode')
        #self.mode_button = buttons.GenToggleButton(self.panel, -1, "Autonomous Mode")

        mode_box.Add(mode_label)
        #mode_box.Add(self.mode_button)

        go_box = wx.BoxSizer(wx.HORIZONTAL)
        go_button = wx.Button(self.panel, label='Go!')
        go_button.Bind(wx.EVT_BUTTON, self.submit)
        go_box.Add(go_button)

        vbox_main.Add(url_box)
        vbox_main.Add(file_box)
        vbox_main.Add(mode_box)
        vbox_main.Add(go_box)

        self.panel.SetSizer(vbox_main)
        self.Show(True)

    def search(self):
        pass

    def submit(self):
        pass

Answer №1

To properly add a wxBoxSizer, make sure to include the following line in your code:

url_box.Add(wxBoxSizer)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Obtaining a comprehensive list of files in a subdirectory, including their full paths

I currently have a directory structure set up like this: Main Directory - Subdirectory - subfile1 - subfile2 - file1 - file2 When I list the contents, it displays as follows: arr=os.listdir(.) -Subdirectory1, f ...

Issue: Unrecoverable Fault Encountered During MYSQL Script Execution

I'm currently working on integrating MYSQL with Python CGI-Bin. However, I keep encountering an issue that I can't seem to resolve. I am running this on a Windows 8 machine with Python version 2.7.8. I've searched online for solutions but h ...

Steps for generating grouped and stacked bar charts

Dealing with a large dataset that includes multiple subsidiaries catering to three distinct customer groups across different countries can be quite challenging. Even though the provided example is simplified, the reality involves significantly more subsidi ...

Python BeautifulSoup scraping from a website with AJAX pagination

Being relatively new to coding and Python, I must admit that this question may seem foolish. But, I am in need of a script that can navigate through all 19,000 search results pages and extract the URLs from each page. Currently, I have managed to scrape th ...

Error: Unable to locate module _vectorized

Using the Shapely package for my Python and Plone Project involves adding it to the `eggs` section in the packages.cfg file like this: [eggs] main = Shapely However, during bin/buildout, I encountered an issue with shapely.vectorized. The error mes ...

Guide to downloading a file using Python, Selenium, and PhantomJS

I am currently facing a challenge where I need to login to a website and download a CSV file from a Linux server in a headless manner. The webpage utilizes JavaScript and is dependent on it for functionality. After conducting some research, I decided to u ...

What is the best way to change the column names from 'unnamed:0' to columns with increasing numbers in Python

Before the transformation: unnamed:0 unnamed:1 unnamed:2 0 Megan 30000 Botany 1 Ann 24000 Psychology 2 John 24000 Police 3 Mary 45000 Genetics 4 Jay 60000 Data Science After ap ...

Pseudonymic user employing hg transformation

I currently have a duplicate mercurial repository and a subversion repository that I have checked out. During the checkout of the subversion repo, I opted to save my password as plain text. My goal is to import the mercurial repo into subversion using th ...

Generate summary columns using a provided list of headers

In my dataset, there is survey data along with columns containing demographic information such as age and department, as well as ratings. I want to enhance the dataset by adding new columns based on calculations from the existing rating columns. The goal ...

Differences between Local and Global importing in Python

Is there a way to force my interpreter (2.7) to import a module from site packages in case of a conflict? Let's say you are working with a directory structure like this: top_level ----cool_mod ----init.py ----sweet_module.py You already have ...

Should one think twice about executing a python script and capturing its results using PHP?

Currently, I am utilizing PHP to execute a Python script, retrieving its output with json.dump and displaying it on my PHP page. However, I have noticed that this process seems to be slower compared to running the script through Python idle. ...

How to Build an RNN using Keras in Python

I am embarking on my machine learning and Keras journey. I created a Neural Network using Keras for regression which has the following structure: model = Sequential() model.add(Dense(57, input_dim=44, kernel_initializer='normal', activation=&ap ...

Using Heroku to deploy with Python and NextJS, struggling to figure out the proper setup for installing NextJS dependencies

I am facing a unique challenge with my project that involves connecting from github to deploy to Heroku using Python for the backend and NextJS for the frontend. My Root Directory structure is as follows: Frontend/ Miscellaneous Python folder A/ Miscellane ...

Python code to compare strings in a list and a matrix

Looking to compare substrings within a matrix and strings within a list. l1=['phone','bag','name','after'] l2=[['phoneedjf','jshph o n ejsh','pho ne'], ['ffaf terekdl','a ...

What serves as the pip counterpart to package.json?

While I am familiar with the requirements.txt file, it only lists dependencies. However, I'm interested in other metadata such as package name, author, and main function. Is there a standard format for this information? I've heard of the setup.p ...

The error message "No module named Image" is indicating that there is a missing module in the specified file path build/exe.win-amd64-3.6/scipy/misc

I am working on a Python application for image processing that will be compiled into an EXE file. My tools of choice are tkinter and cx_Freeze. However, I have encountered an error during the process. https://i.stack.imgur.com/ThRs4.jpg Below is the con ...

I encountered a malfunction in a section of Python 3 code that I created

Unfortunately, the code snippet below is experiencing some issues. Error: '<' not supported between instances of 'str' and 'int' Code: name = input() age = input() if name == ('alice'): print('hello alice ...

Creating graphs in Python on a Linux system can be done without the need for an

As a newcomer to the world of Python, I am diving into the realm of graphs. Can someone provide guidance on whether it's possible to plot graphs using matplotlib in the console on a Linux system without an active XSERVER? Thank you. ...

Encountered an issue when attempting to select the password field in order to log into a Google account using

Having some trouble automating the login process for my Gmail account. Managed to find the email element with an ID, but hitting a roadblock trying to locate the Password element as it doesn't have an ID. Here's what I've attempted: passw ...

django: how to assign a different column name to a foreign key id

I am working with a model called mykategori class mykategori(models.Model): w_id_kategori = models.AutoField(primary_key=True) w_nama_kategori = models.CharField(max_length=50, null=True) def __str__(self): return self.w_nama_kategori ...