Bitcoin Forum
December 14, 2024, 05:30:46 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum appImage console  (Read 151 times)
browser528 (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
February 24, 2021, 12:53:52 PM
 #1

Hej
I have a running Electrum Wallet and have started the Console and I have a prompt
Please give me some explanation of what is the explanation of the text ans its meaning.
Please use as simple/basic answer as possible.

regards

>>> 1+2
3
>>>
then I do, with less success

>>> my_private_key = random_key()
 
Traceback (most recent call last):
    my_private_key = random_key()
                   ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_electr163Txz/usr/lib/python3.7/site-packages/electrum/gui/qt/console.py", line 262, in exec_command
    exec(command, self.namespace, self.namespace)
  File "<string>", line 1, in <module>
NameError: name 'random_key' is not defined
>>>
mocacinno
Legendary
*
Offline Offline

Activity: 3612
Merit: 5279


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
February 24, 2021, 01:01:34 PM
 #2

Where did you get the console function random_key()?
It doesn't seems to be a function from electrum...

https://github.com/spesmilo/electrum/search?q=random_key

Code:
>>>commands()
"add_lightning_request add_peer add_request addtransaction broadcast changegaplimit clear_invoices clear_ln_blacklist clear_requests close_channel close_wallet commands convert_xkey create createmultisig createnewaddress decode_invoice decrypt deserialize dumpgraph dumpprivkeys enable_htlc_settle encrypt export_channel_backup freeze get get_channel_ctx get_ssl_domain get_tx_status get_watchtower_ctn getaddressbalance getaddresshistory getaddressunspent getalias getbalance getconfig getfeerate getinfo getmasterprivate getmerkle getminacceptablegap getmpk getprivatekeyforpath getprivatekeys getpubkeys getrequest getseed getservers gettransaction getunusedaddress help import_channel_backup importprivkey inject_fees is_synchronized ismine lightning_history list_channels list_invoices list_peers list_requests list_wallets listaddresses listcontacts listunspent lnpay load_wallet make_seed nodeid normal_swap notify onchain_history open_channel password payto paytomany removelocaltx restore reverse_swap rmrequest searchcontacts serialize setconfig setlabel signmessage signrequest signtransaction stop sweep unfreeze validateaddress verifymessage version"

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
browser528 (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
February 24, 2021, 05:31:23 PM
 #3

It comes from a try to do
Pip install bitcoin
from bitcoin import *

Maybe stupid but anyhow a try.

Is the cause of the missing function that this console can not import other libraries
or
is the appimage as such that not allow importing.

regards
mocacinno
Legendary
*
Offline Offline

Activity: 3612
Merit: 5279


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
February 25, 2021, 06:36:32 AM
 #4

that is, in fact, a good question.... To be honest, i've never tried to import modules from electrum's console.
When trying right now, i had a similar experience, so you're probably correct in saying you cannot import external modules in electrum's console... Maybe we can leave this thread open to see if ThomasV has some additional info about this?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ABCbits
Legendary
*
Offline Offline

Activity: 3094
Merit: 8186


Crypto Swap Exchange


View Profile
February 25, 2021, 01:27:57 PM
Merited by mocacinno (1), Husna QA (1)
 #5

You got me curious, so i downloaded Electrum 4.0.9 AppImage and tried importing few library and here's the result

1. Importing built-in library shows no problem

Code:
>>> import sqlite3
>>> import datetime

2. Importing library required by Electrum (https://github.com/spesmilo/electrum/blob/master/contrib/requirements/requirements.txt) shows no problem either

Code:
>>> import qrcode
>>> import bitstring

3. Importing library installed with pip command shows same error

Code:
>>> import jellyfish
Traceback (most recent call last):
    import jellyfish
         ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_electrGXmrQe/usr/lib/python3.7/site-packages/electrum/gui/qt/console.py", line 262, in exec_command
    exec(command, self.namespace, self.namespace)
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'jellyfish'
>>> import pandas
Traceback (most recent call last):
    import pandas
         ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_electrGXmrQe/usr/lib/python3.7/site-packages/electrum/gui/qt/console.py", line 262, in exec_command
    exec(command, self.namespace, self.namespace)
  File "<string>", line 1, in <module>

However trying same thing with Electrum installed with pip from source code shows no problem.

Code:
>>> import jellyfish
>>> import pandas

I think Electrum AppImage have it's own python and isolated from python or python library installed your OS.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
browser528 (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
February 26, 2021, 03:03:05 PM
 #6

Thanks for your curiosity and efforts . I will definetely wait for some explanations.

Do you think an standard install without not using the appImage wallet would give other import possibilities.
Or, do you think the the appimage is type of a 'virtual OS' and that the same is true for the wallet as such also.

That was some questions and while on my way......

Can you locate some wallet program example  for me to look at.

Best regards
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4363

<insert witty quote here>


View Profile
February 27, 2021, 07:51:12 AM
Merited by khaled0111 (1)
 #7

Can I ask why you need/want to be able to import modules on the Electrum console? Huh It's really not the place to be writing raw python code! Shocked

If you need to be creating a Python script, go ahead and create a Python script and then run it using Python... Tongue

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
browser528 (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
February 27, 2021, 07:45:26 PM
 #8


This is a hard question and I am not quite sure I can give a good answer , because the thoughts have a tendency to live its own life without a good thinking behind.

However it started when I realised that installing an appImage was quite easy compared to other Linux installations where the screen is flashing with lines and lines and lines some of them in red which is very scary for an old fashioned Win user.
I also had in mind that the appimage could be kind of VirtualBox installation isolated from rest of the OS.

Further down the line of muddled thougths , wallet transactions would be sent at certain conditions such as date , time, low transaction fees........all this programmed into a wallet.

regards
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!