cgi - Python, who is calling my python module -


I have a Python module which can be asked by CGI script (by giving information from a form) or command line (it Pass options and arguments from the command line). What is a method of installing if the module is called from CGI script or from the command line ??

"post-text" itemprop = "text">

This will:

import os if os.environment.has_key ('REQUEST_METHOD'): # You are running as a CGI script Else: # You are running from the command line

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -