@giovanniI'm struggling. I looked at that script. There's a lot of new stuff in there for me. I have a basic idea of what I am trying to do, but all of my attempts are failing, and I can't really understand why @deanishe is doing the things he's doing. For example, he talks about nohupping (one of the new things for me), and I genned up on what that is, but I can't see where he does that in that script. It's making my head spin.
Here's the money shot in the rough code I've written so far, just to try and get my head around things:
pid = os.fork()
if pid > 0:
# return results to alfred on main process
sys.stdout.write(json.dumps({'rerun': 1, 'variables': {'rerun': 'True', 'data': json.dumps(make_result_set(data))}, 'items': make_result_set(data)}))
sys.exit(0)
else:
if sys.argv[3] == 'False':
subprocess.Popen(
['nohup', '/usr/bin/python3', '/Users/danluba/PycharmProjects/AlfredMusicSearch/images.py', "&",
json.dumps([d['img'] for d in data if d['img'] is not None]), "Bandcamp"], stdin=None, stdout=None, stderr=None
)
That was me trying to nohup my subprocess and disconnect from all my buffers, but I guess it's not working because the images are not downloading. If there are any pointers that could be given to me, me would be very grateful for receiving them.