Python script to import a specific midi file from a directory

I’d like to automatically import a specific midi file from a directory using Audacity scripting with python.
The following script works to open the ImportMIDI: file selection window, allowing me to manually select a file…but that’s not what I want.

toName = ‘\\.\pipe\ToSrvPipe’
fromName = ‘\\.\pipe\FromSrvPipe’
eol = ‘\r\n\0’
fileName=‘C:\ElectricBass.mid’
toFile = open(toName, ‘w’)
fromFile = open(fromName, ‘rt’)
toFile.write(‘ImportMIDI:’)

I want to automatically import a specific midi file into Audacity without having to select it from the directory list. A pseudo example would be something like…
toFile.write(‘ImportMIDI: fileName=ElectricBass.mid’)

Here is my system configuration info
Windows 10 Home version 1903, Audacity 2.3.3, Python 3.7.4

Thank You for taking the time to look at this.

I think you’re out of luck for now. There isn’t a Scripting command for importing MIDI files.