1,105,546 Community Members

Where can I download the random module?

Member Avatar
entropic3105
Light Poster
30 posts since Jan 2013
Reputation Points: 12 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Where can I download the random module, because I've been looking for weeks and can't find a site where I can download it.

Member Avatar
vegaseat
DaniWeb's Hypocrite
6,984 posts since Oct 2004
Reputation Points: 1,544 [?]
Q&As Helped to Solve: 1,872 [?]
Skill Endorsements: 67 [?]
Moderator
 
0
 

Should be part of your Python installation.
random.py should be in your /Lib folder

You may have created a test file random.py in your working directory. Rename that one to something like random_test.py so Python will look further.

Remember that Python will look in your working directory first and than in the Lib directory. Naming one of your files the same as a Python library file is a common mistake for beginners.

Member Avatar
Schol-R-LEA
Nearly a Posting Virtuoso
1,396 posts since Oct 2010
Reputation Points: 635 [?]
Q&As Helped to Solve: 226 [?]
Skill Endorsements: 28 [?]
 
0
 

You sholdn't need to; it is part of the standard Python library. I gather you were unable to use it? What version of Python are you using? What exactly happens if you enter the following into the Python interpreter prompt?

import random

random.randint(0, 6)
Member Avatar
vegaseat
DaniWeb's Hypocrite
6,984 posts since Oct 2004
Reputation Points: 1,544 [?]
Q&As Helped to Solve: 1,872 [?]
Skill Endorsements: 67 [?]
Moderator
 
0
 
Member Avatar
entropic3105
Light Poster
30 posts since Jan 2013
Reputation Points: 12 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks, I've been wondering for a while now.

Question Answered as of 11 Months Ago by vegaseat and Schol-R-LEA
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: