joininbox/scripts/scriptstarter.py

23 lines
636 B
Python
Raw Normal View History

2020-01-20 01:03:09 +00:00
#!/usr/bin/env python
import subprocess
import sys
2020-01-21 13:18:19 +00:00
import os
2020-01-20 01:03:09 +00:00
SCRIPT = sys.argv[1]
WALLET = sys.argv[2]
f = open('pw','r')
2020-01-21 13:18:19 +00:00
PW = f.read().strip()
2020-01-20 01:03:09 +00:00
f.close()
2020-01-21 13:18:19 +00:00
os.system('rm -f pw')
2020-01-20 01:03:09 +00:00
process = subprocess.Popen(['python', '%s' %SCRIPT,'%s' %WALLET, '--wallet-password-stdin'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
universal_newlines=True)
process.stdin.write ("%s" %PW)
process.stdin.close()
for line in process.stdout:
print(line)