A python_include() for cgi programming
3 Nov
2020
3 Nov
'20
6:42 p.m.
I have recently have the opportunity to work on a Python web application. I've found it beneficial to reduce duplicate code with the following code lines import textwrap from pathlib import Path exec(textwrap.dedent(Path('myfile.py').read_text())) Perhaps such code could be the basis for a python_include() statement similar to how includes, requires work in PHP. Thank you for any consideration.
1219
Age (days ago)
1241
Last active (days ago)
4 comments
5 participants
participants (5)
-
Cade Brown
-
Mathew Elman
-
Matteo Bertucci
-
Voltron
-
warp_drive enterprise