TransWikia.com

How to return back without complete execution of the function after calling it, in python

Stack Overflow Asked by Sai Reddy on January 26, 2021

I want to run a python file, i.e. retrive.py after conn() and I don’t want to wait until the retrive.py execute completely is there any way to do so.

The following is the code..

def add(request):
    dat = str(request.POST["dat"])
    tim = str(request.POST["tim"])
    tskt = str(request.POST["taskt"])
    tskc = str(request.POST["taskc"])
    op = str(request.POST['exampleRadios'])
    tim = tim+":00"
    if op == 'shutdown':
       tskt = op
    conn(dat, tim, tskt, tskc)
    os.system("py retrive.py")
    return render(request, 'finale/hi.html', {'name': 'task added'})

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP