ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
Is there anything obviously wrong with the process described here? I have carefully recreated all the steps but have not had any success. Is it me?
No idea, since you tell us nothing about your setup, what you've done to try to troubleshoot things, any relevant errors/messages you've seen, what kind of system, what's in that python script, etc. Running a python program from HTML is no different than running any other program from HTML; that procedure doesn't look at all complicated.
With no information, we cannot guess as to what could be your problem. Short answer to your question: no, nothing obviously wrong (other than the fact you're trying to DO that at all, which is incredibly insecure).
Any recent version is using python version 3 which the interpreter is called python3. Whether the web server environment includes /usr/bin or has access to the location where the python script exists depends on the distribution.
That is not the right approach. I mean you do not need to ask us to review that page, but what you have made. So please give us more details about those steps.
Exactly what did you try, what's happened ... http://www.catb.org/~esr/faqs/smart-...html#beprecise
The Python [u]subprocess[/b] system does, indeed, allow you to "fork" child processes within a single computer environment, and conveniently do things like "collect their results."
However, the quoted article is "mightily misleading(!)" when it goes on to say this:
Quote:
You can also use a Python web framework, such as Flask or Django, to run Python scripts from HTML buttons. Web frameworks provide a number of features that make it easier to develop web applications, such as routing, templating, and sessions.
Because it clearly shows that this person who describes himself thusly: (emphasis mine)
Quote:
Student of Computer Application and Network Administration || Cloud Technology and Cyber Security Enthusiast
... is very-clearly still a "student." He does not (yet) know the difference.
It is one thing to "conveniently execute subcommands on your own computer." (Which subprocess is specifically designed to do.) But, entirely a different thing to "execute a remote procedure call" (by whatever means ...) to execute them on another.
Of course, since you have not yet entirely described your scenario in your original post, all of what I am saying is "just a guess."
Last edited by sundialsvcs; 03-18-2024 at 07:04 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.