Bitcoin Forum

Bitcoin => Electrum => Topic started by: El3k0n on March 29, 2014, 07:05:51 PM



Title: Is it possible to send commands to the Electrum Console through a Python script?
Post by: El3k0n on March 29, 2014, 07:05:51 PM
I have a long list of private keys and I need to add them to my Electrum wallet. Instead of adding them one by one, I tought to use Python because it could do the work much much faster. Is there a way to do that?


Title: Re: Is it possible to send commands to the Electrum Console through a Python script?
Post by: rini17 on March 29, 2014, 08:24:46 PM
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.


Title: Re: Is it possible to send commands to the Electrum Console through a Python script?
Post by: El3k0n on March 29, 2014, 09:47:34 PM
Alternatively, you can write your own python module that calls electrum functions, import it in the console and call it.

How can I import my module with the Electrum console? I tried changing the path to the script's directory and importing it, but it says the module doesn't exist.


Title: Re: Is it possible to send commands to the Electrum Console through a Python script?
Post by: Abdussamad on March 30, 2014, 01:45:26 AM
You can paste multiple keys into the import key text field. One line per key.