aboutsummaryrefslogtreecommitdiff
path: root/utils/python-rpc/console.py
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-30 11:42:26 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-11 11:08:24 +0000
commit6fd8834d9dfde07b58792a352b2f7bae67deef47 (patch)
treeeff7f72cbd658c042c48315d293ff4795751c53b /utils/python-rpc/console.py
parentfunctional_tests: cold signing key images/outputs import/export (diff)
downloadmonero-6fd8834d9dfde07b58792a352b2f7bae67deef47.tar.xz
console.py: add tab completion
Diffstat (limited to 'utils/python-rpc/console.py')
-rwxr-xr-xutils/python-rpc/console.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/python-rpc/console.py b/utils/python-rpc/console.py
index 444a9cc59..1d831c711 100755
--- a/utils/python-rpc/console.py
+++ b/utils/python-rpc/console.py
@@ -63,5 +63,14 @@ if 'status' in res:
else:
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('The \'rpc\' object may now be used to use the API')