mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
console.py: add tab completion
This commit is contained in:
parent
04a20cb242
commit
6fd8834d9d
1 changed files with 9 additions and 0 deletions
|
@ -63,5 +63,14 @@ if 'status' in res:
|
||||||
else:
|
else:
|
||||||
rpc = wallet.Wallet(port=port)
|
rpc = wallet.Wallet(port=port)
|
||||||
|
|
||||||
|
# add tab completion if we can: https://stackoverflow.com/questions/246725
|
||||||
|
try:
|
||||||
|
import readline
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
import rlcompleter
|
||||||
|
readline.parse_and_bind('tab: complete')
|
||||||
|
|
||||||
print('Connected to %s RPC on port %u' % ('daemon' if 'status' in res else 'wallet', port))
|
print('Connected to %s RPC on port %u' % ('daemon' if 'status' in res else 'wallet', port))
|
||||||
print('The \'rpc\' object may now be used to use the API')
|
print('The \'rpc\' object may now be used to use the API')
|
||||||
|
|
Loading…
Reference in a new issue