Ejemplo n.º 1
0
from question2 import (Article, Picture)
import random

print "Testing question 2"
raw_input("Press enter to continue.")
print "Creating a ugly article..."
badArticle = Article("Aliens!", "There are aliens", "Not YB")

raw_input("Press enter to continue.")
print "Showing it..."
print "\n"
badArticle.show()

raw_input("Press enter to continue.")
print "loading a better article from article.json"
betterArticle = Article.fromFile("article.json")

raw_input("Press enter to continue.")
print "Showing the better article"
print "\n"
betterArticle.show()

raw_input("Press enter to continue.")
print "Changing the creator to random.random()"
betterArticle.creator = "{}".format(random.random())

raw_input("Press enter to continue.")
print "Showing the better article again, with new creator"
print("\n")
betterArticle.show()