pyblock/feed.py
curly60e cd7640e591
Bug Fix when closing
When apply Control+C it should kill both process api_data_reader.py y demo-rx.py.
2020-06-13 20:52:04 -03:00

24 lines
768 B
Python

#Developer: Curly60e
#PyBLOCK its a clock of the Bitcoin blockchain.
#Version: 0.4.0
import os
import os.path
import time as t
def readFile():
try:
print ("\n\033[1;34;40mWaiting for new data...\n")
while True:
downloadsFolder = 'downloads/'
if not os.listdir(downloadsFolder):
continue
else:
print("\t\t\n\033[1;33;40mNew message from Space just arrived...\033[0;37;40m\n")
os.system("cat downloads/*")
os.system("rm downloads/*")
except:
os.system("ps -ef | grep api_data_reader.py | grep -v grep | awk '{print $2}' | xargs kill -9")
os.system("ps -ef | grep demo-rx.py | grep -v grep | awk '{print $2}' | xargs kill -9")