M
M
maryaturova2021-06-29 16:06:48
Python
maryaturova, 2021-06-29 16:06:48

Connect external python script?

Most likely nonsense! :)) There is such a thing in js - load an external script.
Is there something similar in Python?
It's just convenient, I uploaded the modified script to the server. And scripts from clients are already automatically picked up.
Or how is it generally done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-06-29
@maryaturova

In js, there is such a thing - load an external script.
Is there something similar in Python?

They compared the ass with a finger. What you say is only found in browser JS. In the same node.js, this is not done, and it is very good that this is so.
You will need to add a stray to your script that will check for a new version on the server (and on which one? and what if it has changed?), download it (and if the Internet is gone? you need to continue downloading) and unpack instead of the old one (what about backup in case the update is rolled back?). And only then run the unpacked (new or old).
Add to this the need for migration scripts (and if "downloading and running a new version" is not enough? maybe you need to correct the database structure one-time, or something else?), the ability to roll back a broken update back (otherwise it will turn out to be a setup for clients, if something something goes wrong), in the ability to determine the order of changing versions (maybe our update scripts do not support jumping through three versions?) ... and you will understand that this is a huge task if you solve it properly, and not how it happened.
However, there are also solutions that take on some of these tasks.
For example, the same pip can download packages from github, so that the client can do something like
pip install --upgrade git+https://github.com/youracc/[email protected]

But most of the tasks still remain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question