Skip to content

Instantly share code, notes, and snippets.

@jbfink
Created November 2, 2019 21:32
Show Gist options
  • Save jbfink/8d39bf7a60a5cbaea34e8c5d1fc9a82c to your computer and use it in GitHub Desktop.
Save jbfink/8d39bf7a60a5cbaea34e8c5d1fc9a82c to your computer and use it in GitHub Desktop.
sentiment analysis python script, MY FIRST PYTHON SCRIPT
import sys
from textblob import TextBlob
print("The file you selected is:", sys.argv[1])
text_file = open(sys.argv[1],"r")
output = text_file.read()
#print(output)
text_sentiment = TextBlob(output)
print(text_sentiment.sentiment)
print("I'M PROGRAMMING")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment