Protect main script from being executed outside the main process #986
Labels
Core
Related to Taipy Core
📄 Documentation
Internal or public documentation
📈 Improvement
Improvement of a feature.
🟧 Priority: High
Stalls work on the project or its dependents
🔒 Staff only
Restricted to CC staff members
Milestone
Taipy can start subprocesses using a 'spawn' method. Because of that, the main module is re-executed every time a sub-processed is spawned. In order NOT to re-execute some code that should not be re-executed, the good practice Taipy wants to enforce is to add the boilerplate
condition
if __name__ == "__main"
at the top of the main script.if __name__ == "__main"
condition is explicitly documented and explained in the standalone execution mode documentation (user, ref, tuto, etc.) The motivation should be explicit.if __name__ == "__main"
in all chaptersThe text was updated successfully, but these errors were encountered: