Jump to content

[Solved] library for python


ebgds

Recommended Posts

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

Link to comment
Share on other sites

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 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

image.png.9a591925695cbca217bca7fc6d16f29b.png

Link to comment
Share on other sites

  • Krydos changed the title to [Solved] library for python

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...