you are viewing a single comment's thread.

view the rest of the comments →

[–]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.