F
F
fandorin_official2019-09-26 08:48:49
Python
fandorin_official, 2019-09-26 08:48:49

How to start execution of one script from another?

Faced such a problem. If one script that runs from this file:

from flask import redirect, send_from_directory, send_file

svc = GenericService(__name__, 'config')
app = svc.get_app()
app.add_api('./openapi/specifications.yml')


@app.app.route('/')
def home():
    return redirect('/v')


@app.app.route('/v1/<path:path>')
def send_frontend(path):
    return send_from_directory('frontend', path)


@app.app.route('/f')
def send_frontend_index():
    return send_file('frontend/index.html', None, False, None, False, 0)


if __name__ == '__main__':
    app.run(debug=True)

Can you please tell me the best way to implement the launch of this script from another file? That is, there is some other script, in the script of which it is sometimes necessary to deploy this script. In which direction to drip?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-09-26
@Zarom

Here they offer one of 7 options to use
https://stackoverflow.com/a/20749411

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question