Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Update startup.py #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions tools/startup.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
#!/usr/bin/python

print
print "checking for nltk"
print()
print ("checking for nltk")
try:
import nltk
except ImportError:
print "you should install nltk before continuing"
print ("you should install nltk before continuing")

print "checking for numpy"
print ("checking for numpy")
try:
import numpy
except ImportError:
print "you should install numpy before continuing"
print ("you should install numpy before continuing")

print "checking for scipy"
print ("checking for scipy")
try:
import scipy
except:
print "you should install scipy before continuing"
print ("you should install scipy before continuing")

print "checking for sklearn"
print ("checking for sklearn")
try:
import sklearn
except:
print "you should install sklearn before continuing"

print
print "downloading the Enron dataset (this may take a while)"
print "to check on progress, you can cd up one level, then execute <ls -lthr>"
print "Enron dataset should be last item on the list, along with its current size"
print "download will complete at about 423 MB"
import urllib
print ("you should install sklearn before continuing")

print()
print ("downloading the Enron dataset (this may take a while)")
print ("to check on progress, you can cd up one level, then execute <ls -lthr>")
print ("Enron dataset should be last item on the list, along with its current size")
print ("download will complete at about 423 MB")
import urllib.request
url = "https://www.cs.cmu.edu/~./enron/enron_mail_20150507.tar.gz"
urllib.urlretrieve(url, filename="../enron_mail_20150507.tar.gz")
print "download complete!"
urllib.request.urlretrieve(url, filename="../enron_mail_20150507.tar.gz")
print ("download complete!")


print
print "unzipping Enron dataset (this may take a while)"
print()
print ("unzipping Enron dataset (this may take a while)")
import tarfile
import os
os.chdir("..")
tfile = tarfile.open("enron_mail_20150507.tar.gz", "r:gz")
tfile.extractall(".")

print "you're ready to go!"
print ("you're ready to go!")