diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-05-25 09:44:36 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-05-25 09:44:36 (GMT) |
commit | a7514993637aa2f2514fd7e5ab195088efa31482 (patch) | |
tree | 617c8e19f0902e97f4ccaaff8a4affd59c03eef5 /Lib/sysconfig.py | |
parent | 4fb18010f5e16533feb7d3e88d8c11ec522cc98b (diff) | |
download | cpython-a7514993637aa2f2514fd7e5ab195088efa31482.zip cpython-a7514993637aa2f2514fd7e5ab195088efa31482.tar.gz cpython-a7514993637aa2f2514fd7e5ab195088efa31482.tar.bz2 |
Made sysconfig a script that displays useful information - #8770
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index a95ea8d..007d82b 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -686,3 +686,22 @@ def get_platform(): def get_python_version(): return _PY_VERSION_SHORT + +def _print_dict(title, data): + for index, (key, value) in enumerate(sorted(data.items())): + if index == 0: + print('{0}: '.format(title)) + print('\t{0} = "{1}"'.format(key, value)) + +def _main(): + """Displays all information sysconfig detains.""" + print('Platform: "{0}"'.format(get_platform())) + print('Python version: "{0}"'.format(get_python_version())) + print('Current installation scheme: "{0}"'.format(_get_default_scheme())) + print('') + _print_dict('Paths', get_paths()) + print('') + _print_dict('Variables', get_config_vars()) + +if __name__ == '__main__': + _main() |