I've been coding a text editor, and it has the function to change the default font displayed in the wx.stc.SyledTextCtrl
.
I would like to be able to save the font as a user preference, and I have so far been unable to save it.
The exact object type is <class 'wx._core.Font'>
.
Would anyone know how to pickle/save this?
Probably due to its nature, you cannot pickle
a wx.Font
.
Your remaining option is to store its constituent parts.
Personally, I store facename, point size, weight, slant, underline, text colour and background colour.
How you store them is your own decision.
I use 2 different options depending on the code.
sqlite3
database, which allows for multiple
indexed entries..ini
file using
configobj
Both sqlite3
and configobj
are available in the standard python libraries.