ºìÁªLinuxÃÅ»§
Linux°ïÖú

pyinfo()£ºÒ»¸öÏñphpinfoµÄ Python ½Å±¾

·¢²¼Ê±¼ä:2015-11-04 17:15:34À´Ô´:ºìÁª×÷Õß:zfli_nfswuxi
×÷Ϊһ¸öÈÈÖÔÓÚ php µÄ¼Ò»ï£¬ÎÒÒѾ­Ï°¹ßÁËʹÓà phpinfo() º¯ÊýÀ´ÈÃÎÒÇáËÉ·ÃÎÊ php.ini ÀïµÄÅäÖúͼÓÔصÄÄ£¿éµÈÐÅÏ¢¡£µ±È»ÎÒÒ²ÏëҪʹÓÃÒ»¸ö²»´æÔÚµÄ pyinfo() º¯Êý£¬µ«Ã»Óгɹ¦¡£°´Ï CTRL-E£¬google Ò»ÏÂÊÇ·ñÓÐÈËʵÏÖÁËËü£¿

Êǵģ¬ÓÐÈËÒѾ­ÊµÏÖÁË¡£µ«ÊÇ£¬¶ÔÎÒÀ´ËµËü·Ç³£ÄÑ¿´¡£»ÄÃý£¡ÒòΪÎÒÎÞ·¨ÈÌÊܳóªµÄ²¼¾Ö£¬¿È¿È£¬ÎÒ²»µÃ²»Ç××Ô¶¯ÊÖÀ´¸Ä¸Ä¡£ÎÒÓÃÕÒµ½µÄ´úÂ룬²¢ÖØнøÐв¼¾Öʹ֮¸üºÃ¿´µã¡£Python ¹Ù·½ÍøÕ¾µÄ²¼¾Ö¿´ÆðÀ´²»´í£¬ÄÇôºÎ²»½èÓÃËûÃǵÄÑÕÉ«ºÍ±³¾°Í¼Æ¬ÄØ£¿Êǵģ¬ÕâÌýÆðÀ´ÏñÒ»¸ö¼Æ»®¡£

Gist ´úÂëµØÖ·
ÏÂÔصØÖ·
Àý×Ó
ÌáÐÑÄãÏ£¬ÎÒ½ö½öÔÚ Python 2.6.4 ÉÏÔËÐйýËü£¬ËùÒÔÔÚ±ðµÄ°æ±¾ÉÏ¿ÉÄÜÓзçÏÕ£¨½«ËüÒÆÖ²µ½ÈκÎÆäËû°æ±¾ËüÓ¦¸ÃÊÇûÓÐÎÊÌâµÄ£©¡£ÒªÊ¹ÓÃËü£¬Ö»ÐèÒªµ¼Èë¸ÃÎļþ£¬ ²¢µ÷ÓÃpyinfo()º¯ÊýµÃµ½ËüµÄ·µ»ØÖµ´òÓ¡µ½ÆÁÄ»ÉÏ¡£ºÃàÏ£¡

Èç¹ûÄãÔÚʹÓà mod_wsgi ʱûÓеõ½ÕýÈ·µÄ·µ»Ø½á¹û£¬Äã¿ÉÒÔÈçÏÂÔËÐÐËü£¨µ±È»µÃÌ滻·¾¶£©£º

def application(environ, start_response):
import sys
path = 'YOUR_WWW_ROOT_DIRECTORY'
if path not in sys.path:
sys.path.append(path)
from pyinfo import pyinfo
output = pyinfo()
start_response('200 OK', [('Content-type', 'text/html')])
return [output]
via£ºhttp://bran.name/articles/pyinfo-a-good-looking-phpinfo-like-python-script/

Èç¹ûÏëÉîÈëÌåÑéLINUXϵͳµÄÐÂÊÖ£¬Ò²¿ÉÒÔÏÈÏÂÔØÒ»¸ö·½µÂLinuxÈí¼þÖÐÐÄÊÔÓÃһϡ£
Ãâ·ÑÏÂÔصØÖ·£ºhttp://www.nfs-cloud.cn:81/appCenter/open/softcenter
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 2 ÌõÆÀÂÛ

  1. qwlp19910807 ÓÚ 2016-07-06 13:51:52·¢±í:

    ѧϰһÏÂ

  2. zx911024 ÓÚ 2016-05-14 17:34:38·¢±í:

    ¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬¸Ðл¥Ö÷£¬