# -*- coding: cp1252 -*- #. // GetConfiguration.py #. // Lister la configuration de Python. import locale import sys from _by_ferase import by_ferase # // Détruire un fichier. from _by_ShellExecute import by_ShellExecute # // Effectue une opération sur un fichier spécifié. from _by_writeLine import by_writeLine # // Ecriture d'une ligne dans un fichier texte. cFileOut = "_Result.txt" def GetConfiguration(): by_ferase( cFileOut ) oFileOut = open( cFileOut, "w" ) by_writeLine( oFileOut, "Lister la configuration de Python.\n" ) by_writeLine( oFileOut, "getdefaultlocale() : " + str( locale.getdefaultlocale() ) ) by_writeLine( oFileOut, "getlocale() : " + str( locale.getlocale() ) ) by_writeLine( oFileOut ) by_writeLine( oFileOut, "Version de Python : " + sys.version ) by_writeLine( oFileOut ) aArg = sys.argv by_writeLine( oFileOut, "Script en cours : " + aArg[ 0 ] ) by_writeLine( oFileOut ) by_writeLine( oFileOut, "Arguments script : " + str( len( aArg ) - 1 ) + " arguments" ) for i in range( 1, len( aArg ) ): by_writeLine( oFileOut, " "*21 + aArg[ i ] ) #. endfor i by_writeLine( oFileOut ) aPath = sys.path by_writeLine( oFileOut, "Dossiers avec path : " + str( len( aPath ) ) + " dossiers" ) for i in range( len( aPath ) ): by_writeLine( oFileOut, " "*21 + aPath[ i ] ) #. endfor i by_writeLine( oFileOut ) aModule = sys.modules by_writeLine( oFileOut, "Modules : " + str( len( aModule ) ) + " modules" ) for m in aModule: by_writeLine( oFileOut, " "*21 + m ) #. endfor m by_writeLine( oFileOut ) by_writeLine( oFileOut, "sys.getdefaultencoding() : " + sys.getdefaultencoding() ) by_writeLine( oFileOut, "sys.getrecursionlimit() : " + str( sys.getrecursionlimit() ) ) by_writeLine( oFileOut ) oFileOut.close() by_ShellExecute( cFileOut ) return 0 GetConfiguration() ''' Dernière modification : 2022-03-05 '''