I've seen in this link where everytime we will intiate webserver.py script which listens the user request & respond.
In Ubuntu we will usually run in Terminal.Similarly,i would like to know how to run the python file which is in the website.
[EDIT]
Here are links to topics that will help you on your way
Flask/REST/JSON
Sandbox
Related
I'm automating a few things where I work regarding communication using WhatsApp. I have implemented a few scripts using Python (pywhatkit and MySQLdb) that acess my work's database and sends out a few text messages. The thing is, we currently have a local CentOS server up and running and I don't know how to make my script run on that. Like, I was told that the server had no graphical interface, and my script basically opens Firefox and sends texts every once in a while.
How can I make this work from this server? Is there another alternative? This will be used to send a couple of texts every day, so It won't be CPU intensive. Best use scenario would be to run this script every day at a scheduled time, and that's it.
You can use crontab to run script once per day.
Also you can open headless Firefox on CentOS server. Here good explanation how to do it.
I am quite new to web development and have been trying to run some Python code via a PHP script. When working on my localhost, shell_exec works great. However, when putting it on the server (Hostinger), the Python script does not work.
I thought this might be the case because on the localhost it uses the Python installed on my computer, but I am not sure what is the best way around this.
Thank you!
I am trying to execute a python cgi script which is having a bash script that logs into remote servers to get logs. This log is seen in browser.
I am able to run this script from terminal and get expected result. Whereas trying to run this script over a browser. There is no result a blank page shows up.
After lot of analysis found that When running from browser it runs as apache user who does not have permission to login to remote servers.
I want to make it run as a particular user is that possible ?
I have been working on a flask application and it has been working just fine. however, for a couple of hours now, i have not been able to run my application on the web. After running the script on command line as usual, i would copy the ip address to my browser in order to display its content but will not respond anymore. I have tried changing port, and other troubleshooting i suppose should work but has still not been able to get it fixed. Any assistance is highly appreciated.
The error message is " this site can not be reached" when is actually running on the server in command line.
I have a django website hosted on raspberry pi using apache server.
Is there any way I can execute python scripts on the pi server and get the output of the scripts in the website?
I have link to all the python files on the website but when I click them instead of executing the raw code opens.
Aside that this is a very risky thing to do, you can do this in different ways - see these answers, where the second one also shows how to fetch the output:
How can I make one python file run another?
Running shell command from Python and capturing the output