wxPython Demo code unreadable

In download page I found:

A tarball containing the wxPython demo and samples . It is highly encouraged for new wxPython users, and experienced ones too, to download this file. It is a great learning resource with tons of examples showing how to use various components of the wxPython library. Look for a file named like wxPython-demo-VERSION.tar.gz .

So I get it and run it from: https://extras.wxpython.org/wxPython4/extras/4.1.0/wxPython-demo-4.1.0.tar.gz

Code is displayed as hex symbols instead of ascii (image below).


Why? I did not change anything.

Regards Piotr

That’s odd. What is your platform? Anything out of the ordinary in your environment?

Standard Ubuntu 20.04 LTS

Not a solution, but you should be able to get the demo through your package manager.

I am seeing the same behavior,
also with Ubuntu 20.04 LTS.
Python 3.10 in a pipenv virtual environment.
wxPython installed with
python3.10 -m pipenv install https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04/wxPython-4.2.0-cp310-cp310-linux_x86_64.whl

Perhaps not relevant, but my system has an alternate language installed (Japanese), though the alternate language was not selected.
mozc

I had the same problem which I raised in another thread:

At the time I thought I had fixed it by uninstalling the Texlive-fonts-extra package to remove an alternative set of courier fonts.

What is strange is that I re-ran the fc-list | sort | grep -i courier command just now and it shows that I currently have the texlive courier fonts installed again! However, the code is being displayed correctly in the wxPython Demo.

When I did have the problem I was running wxPython 4.1.1 on Linux Mint 20, but I am now running wxPython 4.2.0 on Linux Mint 21.1.

This is an old post but i ran into this problem today 7/6/23
and found a work around.

I am using ubuntu 20.04 LTS, python 3.8, wxpython 4. ?
downloaded via pip yesterday.

As mentioned elsewhere, the demo file StyledTextCtrl_2.py
establishes platform dependent mappings for font aliases:
times, mono, helv => Times, Courier, Helvetica.

Using the open source FontManger app, i established substitutions such that
Times == FreeSerif,
Courier==FreeMono,
Helvetica==FreeSans.

I knew these Free* fonts were installed and could view them using FontManager.

This seems to have fixed the problem after the demo was restarted. My knowledge of linux font infrastructure is deficient. So i have no explanation to offer about the root cause of the issue.

Hope this helps