ユーザーエージェント取得・表示(os.environ['REMOTE_ADDR'])
#! /usr/bin/python # coding: Shift_JIS import os ua = "" if os.environ.has_key('HTTP_USER_AGENT'): ua = os.environ['HTTP_USER_AGENT'] print "Content-type: text/html" print """ <html> <head> <title>ユーザーエージェント取得・表示</title> </head> <body> ユーザーエージェント:%s </body> </html> """ % ua
〔 実行する 〕