3

I want user to use Whois in my website, so I am using ubuntu server and Flask, now the problem is should I run a os.system("whois " + domain). Because it will run the system for all the user who are using the site.

So is there anyway to run the system commands as an instance for every user? like the command only affect the current using user.

and also not only whois, I want to run my own binaries also like this

Jeeva Kumar
  • 353
  • 2
  • 8
  • [click on this link ](https://stackoverflow.com/questions/24580373/how-to-get-whois-info-by-ip-in-python-3)you may find your answer here. it will help you – Shakti Sisodiya Aug 12 '17 at 04:35
  • They are only talking about whois in python libraries, but I need to run system binaries – Jeeva Kumar Aug 12 '17 at 04:45
  • I don't understand this bit: "Because it will run the system for all the user who are using the site." Isn't that a question of how you handle sessions? – tink Aug 12 '17 at 05:21
  • I don't get your issue. Define a flask route, get the user's address from the request object, and run the system binary. – Nadav S. Aug 12 '17 at 06:20
  • what if 100 people doing that same thing, its going to create 100 process in server, I don't want to run it as a separate process, I want that process to be child of the Flask instance. – Jeeva Kumar Aug 12 '17 at 06:27
  • You have Python libraries to do whois calls, so no need to shell out to system. – Patrick Mevzek Jan 02 '18 at 16:08

0 Answers0