区别于python中的命令行和CGI

2024-04-29 08:54:20 发布

您现在位置:Python中文网/ 问答频道 /正文

是否可以区分Python脚本是从web服务器(作为CGI脚本)还是从命令行执行?在

我看到一些只针对PHP和Perl的回复:
What is the canonical way to determine commandline vs. http execution of a PHP script?
How can I determine if a script was called from the command line or as a cgi script?


Tags: the命令行服务器脚本webisscriptwhat