ebgds Posted October 28 Posted October 28 Hi I managed to test a small Python script (3.12) under the httpdocs/cgi-bin directory. To move forward with my project, I need two libraries that are neither installed nor native: web3 (Version: 7.2.0) mysql-connector-python (Version: 9.0.0) Question 1: Can I connect my Python scripts to my own database on my Tommy account? Question 2: Is it possible to run a Python script (on my cgi-bin) once an hour or once a day? Is it possible through the "Schedule a Task" module. And if yes, what is the command line for that ? System user ebgds Regards Eric
ebgds Posted October 28 Author Posted October 28 2 hours ago, ebgds said: Hi I managed to test a small Python script (3.12) under the httpdocs/cgi-bin directory. To move forward with my project, I need two libraries that are neither installed nor native: web3 (Version: 7.2.0) mysql-connector-python (Version: 9.0.0) Question 1: Can I connect my Python scripts to my own database on my Tommy account? Question 2: Is it possible to run a Python script (on my cgi-bin) once an hour or once a day? Is it possible through the "Schedule a Task" module. And if yes, what is the command line for that ? System user ebgds Regards Eric I don't need mysql-connector-python anymore (mysql-connector is OK) I still need web3 And still have the questions
wolstech Posted October 28 Posted October 28 For question 1, yes. For question 2, you should be able to, but not sure what the easiest way to actually run it is since the scheduled tasks are jailed (the scheduler cannot see the Python binary). You may be able to call the file itself, but not sure on that. Krydos has to install the modules for you and can likely also answer the Python scheduling question.
Krydos Posted October 28 Posted October 28 1 hour ago, ebgds said: I still need web3 The modules web3 has been installed on Tommy's Python 3.12. You can see the current list of installed modules at https://krydos1.heliohost.org/pyinfo/info3.12.py 3 hours ago, ebgds said: Question 2: Is it possible to run a Python script (on my cgi-bin) once an hour or once a day? Is it possible through the "Schedule a Task" module. And if yes, what is the command line for that ? Like Wolstech said, the "run a command" option is jailed so it won't be able to find the Python binary, but like it says in our wiki https://wiki.helionet.org/tutorials/plesk/cron-jobs#python we recommend putting the Python script in cgi-bin and calling it with the "fetch a URL" option in scheduled tasks. Just put the full URL to the python script in the URL box. For instance
Recommended Posts