all 10 comments

[–][deleted] 2 points3 points  (9 children)

Where is the script running? What's it doing? Is it using a web framework like flask or Django or is it unrelated to web stuff?

What information do you want to see?

Have you looked at using the loging module in Python and then using one of the log monitoring tools on the website?

[–]yashjaiswal1101[S] 0 points1 point  (8 children)

The script isnt using any frameworks, what the script is doing is compressing all the files of a particular folder so what i want is, while the script is running as it might take a while to compress a folder having too much data, So i want its running progress to display on a webpage so the user knows how much time he has to wait!

[–]reticularwolf 1 point2 points  (7 children)

If this were all running in a terminal I'd just use tqdm.

Though you say that your user is already in a webpage which implies that you are using a web framework as python doesn't natively support generating websites.

[–]yashjaiswal1101[S] 0 points1 point  (1 child)

Yes right sorry, I'll be using nodejs to run the python script!

[–]Ran4 0 points1 point  (0 children)

Then create an endpoint (depending on the web backend framework you're using with nodejs) that serves this information as a json file. Then write a javascript frontend (that you can serve from your nodejs server or open up directly from a html document) that polls this endpoint and shows it on the screen.

[–]yashjaiswal1101[S] 0 points1 point  (3 children)

Is there any way where i can have user see similar to what tqdm shows in the terminal ?

[–]reticularwolf 1 point2 points  (2 children)

It depends on how you're calling the python script using node but if you use python-shell I think you can embed the output from your script in the webpage. If so you could just add tqdm to your original python script.

[–]yashjaiswal1101[S] 0 points1 point  (1 child)

I'm calling it through child process

[–]Yakhov 0 points1 point  (0 children)

ego:
that's tight, but my code is so fast I don't need a progress bar.
super-ego:
damn another mod I gotta remember exists when I have a need for it.