Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Equivalent to phpinfo()

Tags:

python

php

Quite simply, is there a python equivalent to php's phpinfo();? If so, what is it and how do I use it (a link to a reference page would work great).

like image 325
Frank V Avatar asked Apr 03 '10 19:04

Frank V


4 Answers

Check this one out!

pyinfo() A good looking phpinfo-like python script

like image 91
Bran van der Meer Avatar answered Oct 16 '22 16:10

Bran van der Meer


Did you try this out: http://www.webhostingtalk.com/showpost.php?s=f55e18d344e3783edd98aef5be809ac8&p=4632018&postcount=4

like image 25
Michael Avatar answered Oct 16 '22 16:10

Michael


There is nothing directly comparable to phpinfo(), but you can get some bits of information ...

>>> import sys
>>> sys.version
'2.6.4 (r264:75706, Feb  6 2010, 01:49:44) \n[GCC 4.2.1 (Apple Inc. build 5646)]'

>>> sys.platform
'darwin'

>>> sys.modules.keys()
['copy_reg', 'sre_compile', '_sre', 'encodings', 'site', ... ]

>>> import os
>>> os.name
'posix'

>>> import platform
>>> platform.architecture()
('32bit', '')

>>> platform.machine()
'i386'

...
like image 30
miku Avatar answered Oct 16 '22 17:10

miku


Afaik there is no similar function. However, the platform module allows you to access some basic information about the machine, OS and Python.

like image 1
phihag Avatar answered Oct 16 '22 16:10

phihag