Bonjour,
Pour vérifier que le module random est installé, ouvrir une console python (ex ipython) et importer le module random:
$ ipython
Python 2.6.5 (r265:79063, Oct 1 2012, 22:07:21)
Type "copyright", "credits" or "license" for more information.
IPython 0.12 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import random
Il n'y a pas de message d'erreur, le module est bien importé. On peut vérifier par:
In [2]: dir(random)
Out[2]:
['BPF',
'LOG4',
'NV_MAGICCONST',
'RECIP_BPF',
'Random',
'SG_MAGICCONST',
'SystemRandom',
'TWOPI',
'WichmannHill',
'_BuiltinMethodType',
'_MethodType',
'__all__',
'__builtins__',
'__doc__',
'__file__',