ebgds Posted Monday at 06:03 PM Share Posted Monday at 06:03 PM 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 Quote Link to comment Share on other sites More sharing options...
ebgds Posted Monday at 08:39 PM Author Share Posted Monday at 08:39 PM 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 Quote Link to comment Share on other sites More sharing options...
wolstech Posted Monday at 09:14 PM Share Posted Monday at 09:14 PM 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. Quote Link to comment Share on other sites More sharing options...
Krydos Posted Monday at 09:45 PM Share Posted Monday at 09:45 PM 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.