Forums

thread support or a solution for updating the web page from output of long running process

Hi, I have the free account and I am doing some processing that lasts for a few minutes. I have created a basic html page for it to input a few numbers and then spits out the results. The thing is that my processing takes a few minutes and during this time the user has no clue what is going on. I changed my script to spawn one worker thread which would update a global variable with logs and added a new button to my html page to query for results. Now the funny thing is that this works for a very simple thread that contains almost nothing. As soon as I start adding some more to process then it hangs and becomes irresponsible. Then, i noticed the following entry in the logs: *** Python threads support is disabled. You can enable it with --enable-threads *** I also read in the forums that threading is disabled. But then, how come that a very simple thread is still working? 1. So first thing first, is threading supposed to work or not. Just so I know if I should further investigate my solution or drop it. 2. Secondly, can someone please suggest a simple solution for my long running process issue? Recap, what I want to achieve is that the user sees outputs from the running process. I'm not that much versed with front end development, I understand basic html which is pretty much it. Regards, Josh

  1. Threading does not work in a web app on PythonAnywhere. The thread will just not start.
  2. We have a help page that covers that here: http://help.pythonanywhere.com/pages/AsyncInWebApps/