How to access the Kemap settings Preferences (Spacebar Action, Select Mouse button, etc) with python? I use a python script to set up some startup preferences like this:

bpy.context.preferences.view.show_tooltips_python = True

However, there is a particular set of preferences I don't know how to access, the ones in the Keymap section where you specify what spacebar does, what mouse click you use to select, etc.
How can I access these settings?
Search the source
With Developer Extras turned on hover over the enum and  choose edit source
This will open up (for me)  scripts/keyconfigs/blender.py
    # General settings.
    col = layout.column()
    col.row().prop(self, &quot;select_mouse&quot;, text=&quot;Select with Mouse Button&quot;, expand=True)
    col.row().prop(self, &quot;spacebar_action&quot;, text=&quot;Spacebar Action&quot;, expand=True)
    if is_select_left:
        col.row().prop(self, &quot;gizmo_action&quot;, text=&quot;Activate Gizmo Event&quot;, expand=True)

Notice there is a generic property update method load(self, context)
def load():
    from sys import platform
    from bpy import context
    from bl_keymap_utils.io import keyconfig_init_from_data

    prefs = context.preferences
    kc = context.window_manager.keyconfigs.new(IDNAME)
    kc_prefs = kc.preferences

Ok then to the python console
&gt;&gt;&gt; C.preferences.keymap.active_keyconfig
'blender'

&gt;&gt;&gt; C.window_manager.keyconfigs['blender'].preferences['spacebar_action'] = 2

will set to the third option.  The item that matches that number is available enum definition of the the Prefs class.