I have successfully used RPyC (
http://rpyc.readthedocs.org ) for this - in electrum console, import rpyc and start the server. Then when you connect with rpyc client from other python script, you can call any function in running electrum process.
Alternatively, you can write your own python module that calls electrum functions, import it in the console and call it.