I have a python script it sends data permanently and after seeing its output I want to stop or kill the python script .in lettuce I couldn't manage to kill python script.Any idea for this? I tried that:
os.system('pgrep -f sample.py')
time.sleep(3.0)
os.system('pkill -9 -f sample.py')