Last active
December 29, 2015 09:58
-
-
Save readevalprint/7653435 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lesson 1: Namespace. | |
Why is this broken, and how would you fix it? | |
Directions: | |
$ wget https://gist.github.com/readevalprint/7653435/raw/random.py | |
$ python ./random.py | |
random() : | |
Traceback (most recent call last): | |
File "./random.py", line 2, in <module> | |
import random | |
File "/home/tim/django-bitcoin/django_bitcoin/random.py", line 4, in <module> | |
print "random() : ", random.random() | |
TypeError: 'module' object is not callable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import random | |
# First random number | |
print "random() : ", random.random() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment