mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
Made sysconfig a script that displays useful information - #8770
This commit is contained in:
parent
4fb18010f5
commit
a751499363
4 changed files with 64 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue