2👍
✅
import yourscript # is in yourscript.py
yourclass = yourscript.Yourclass()
yourclass.run()
Or something like that?
3👍
Here is an article from Guido Van Rossum, who created python, on doing this. Essentially, you just want to invoke your main() function from your controller.
- [Django]-Is it possible to include a custom 404 view for a Django app without changing anything at the project level?
- [Django]-How to ignore a specific migration?
- [Django]-Django-rest ModelSerializer select fields to display in nested relationship
- [Django]-HTMX + Django – Edit a ModelForm in a HTML Table
Source:stackexchange.com