Hello @Diede Hilhorst
Since External Mode Simulation in Simulink Real-Time allows Simulink model to interact with real-time application running on target hardware. This involves producing C/C++ code from Simulink to run on target hardware and as per my knowledge, MATLAB R2023b currently does not support code generation from python code.
I suggest to try replacing python code with equivalent MATLAB or C/C++ for deployment.