0

How the hell this flask works? I made application.py looks like this:

from flask import Flask, redirect, render_template, request, url_for

import os
import helpers
from analyzer import Analyzer

app = Flask(__name__)

#@app.route("/")
#def index():
#    return render_template("index.html")

#@app.route("/search")
#def search():

# validate screen_name
#    screen_name = request.args.get("screen_name", "")
#    if not screen_name:
#        return redirect(url_for("index"))

# get screen_name's tweets
#    tweets = helpers.get_user_timeline(screen_name)

# TODO
#ensure there are proper tweets downloaded
#if tweets == None:
#    return redirect(url_for("index"))

 # absolute paths to lists
#positives = os.path.join(sys.path[0], "positive-words.txt")
#negatives = os.path.join(sys.path[0], "negative-words.txt")

# instantiate analyzer
#analyzer = Analyzer(positives, negatives)
#    positive, negative, neutral = 100.0, 0.0, 0.0

# for every tweet check positiveness
#score = 0
#for tweet in tweets:
#    score = analyzer.analyze(tweet)
##   if score > 0.0:
#        positive += 1
#    elif score < 0.0:
#        negative += 1
#    else:
#        neutral += 1


# generate chart
#chart = helpers.chart(positive, negative, neutral)

# render results
#return render_template("search.html", chart=chart, screen_name=screen_name)

In other words whole program is one big comment and when I write "flask run" receive information: * Serving Flask app "application" * Forcing debug mode on * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit) * Restarting with stat * Debugger is active! * Debugger pin code: 128-557-285

And when I chose web server from sc50 ide i receive web page with serch engine where after writing screen name I receive yellow circle. Whatever I change in the application.py, nothing change.

Why?

0

Ok, just forget my question, I have mixed upp with folders in sc50 io... I was changing wrong application.py and flask run was using always this oryginal one... unchanged...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .