Answer the question
In order to leave comments, you need to log in
Is it possible to configure Python in such a way that all .py files (as PHP files) are executed in a folder?
Good afternoon!
I'm just starting to learn Python. In connection with this, I have a question.
I installed Flask on the site and I want it to be like in PHP, just create any number of .py files that can be called from the address bar of the browser to execute them. Is there such a possibility in Python?
Well, that is, I create a file in the root of the site blabla.py with the content:
with open('test.txt', 'tw', encoding='utf-8') as f:
pass
Answer the question
In order to leave comments, you need to log in
This simplicity is called "primitive CGI protocol".
This simplicity in fact in slightly more or less complex applications is inconvenient, if you really want to, then it’s easier to write in php.
It's not about the language, it's about using the framework. In PHP, too, you can’t just throw files into a directory and call them by name if you use Laravel for example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question