Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 510249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:05:39+00:00 2026-05-13T07:05:39+00:00

I am on Windows7, using Python 2.6 and wxPython 2.8.10.1. I am trying to

  • 0

I am on Windows7, using Python 2.6 and wxPython 2.8.10.1. I am trying to get this Open File dialog to work but am running into a weird error. This looks like a valid wildcard string to me, but whenever I choose a file and click ‘Ok’ on the File Dialog, I get this:

Traceback (most recent call last):
File "D:\Projects\python\wxTest.py", line 92, in OnOpen
self.__DoOpen()
File "D:\Projects\python\wxTest.py", line 101, in __DoOpen
if open_dlg.ShowModal() == wx.ID_OK:
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py", line 711, in       ShowModal
return _windows_.Dialog_ShowModal(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed at 
  ..\..\src\common\filefn.cpp(1746) in wxParseCommonDialogsFilter(): 
  missing '|' in the wildcard string!

When the dialog is open everything looks fine. Any ideas?

EDIT: typing too fast, forgot to include the wildcard string in question! sorry…

wcd = "All files(*.*)|*.*|Text files (*.txt)|*.txt|"
open_dlg = wx.FileDialog(self, message='Choose a file', defaultDir=directory, defaultFile='', style=wx.OPEN | wx.CHANGE_DIR)
open_dlg.SetWildcard(wcd)
if open_dlg.ShowModal() == wx.ID_OK:
        path = open_dlg.GetPath()
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:05:40+00:00Added an answer on May 13, 2026 at 7:05 am

    The wildcard string has a quirky format, borrowed from Win32:

    Desc1|wildcard1|Desc2|wildcard2 ...
    

    There should be an odd number of pipes, so that the pipe-separated pieces form pairs, a description, and a wildcard. For example:

    Spreadsheet (*.xls)|*.xls|Plain-old text (*.txt)|*.txt|Random noise|*.dat
    

    Note that the description often contains a parenthetical wildcard just for display purposes.

    Your problem is the trailing pipe symbol. Remove it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get information from an SQL database using python I was
I'm trying to extract files from a zip file using Python 2.7.1 (on Windows,
I'm currently using Python 2.7 + wxPython 2.8.11 on my windows machine. While trying
When using os.system to open a file, eg: os.system(r'C:/foo.txt') , the current Python process,
I'm trying to convert a SQLite 2 file to SQLite3 using Python on Windows.
I'm trying to use Py2Exe to take a python program (using wxPython) to a
Python novice here. I am using python2.7.2 on Windows7. I have installed the PyWin32
I'm using Python 2.7.3 on Windows XP via the IDLE GUI, and I'm trying
I want to write text files with DOS/Windows line endings '\r\n' using python running
I am using the urllib2 module in Python 2.6.4, running in Windows XP, to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.