I have an python cgi script that handles login, this is because my website is three (school) websites combined and before my website can be used the data needs to be extracted from those websites. This extraction takes 2 minutes so I want to make a fancy (semi-fake) loading screen.
My register code ends with:
import subprocess
token = "".join(random.choice(
string.ascii_lowercase + string.digits + string.ascii_uppercase)
for _ in range(5)) #generate 5 random characters
#run initScript
subprocess.Popen("python {}/python/initUser.py {} {}".format(
os.getcwd(), uid,token), shell=True, stdin=None, stdout=None, stderr=None,
close_fds=True)
print "Content-type: text/html"
print "Location: registerLoading.php?token={}".format(token)
print
sys.exit(0)
With the subprocess line stolen from: Run Process and Don't Wait
But the subprocess line is still blocking and I can't figure out why.
I'm developing on ubuntu 16.04, and it's going to run on an raspbarry pi 3 (that explains the loading time)