Author Topic: off Topic- Python Flask Programming  (Read 474 times)

Offline rrowan

  • Administrator
  • Sr. Member
  • *****
  • Posts: 5899
  • 08096
off Topic- Python Flask Programming
« on: September 30, 2013, »
Hi Folks,

Any Python, Flask programmers out there?
Just trying to learn how to create a Flask site and I can follow the online tutorials just fine. I have successfully follow this one: You are not allowed to view links. Register or Login and
You are not allowed to view links. Register or Login and
You are not allowed to view links. Register or Login

Months ago I created this simple page to just play around to see how it work

{Please don't laugh}
You are not allowed to view links. Register or Login

I would like to get that simple code in the home.html page of the above tutorial

Here is the code that I put in the routes.py file
Code: You are not allowed to view links. Register or Login
@app.route('/Day')
def Day():
    now = datetime.date.today()
    start = datetime.date(now.year, 1,1)
    delta = now - start
    return "Today is the %d day since the first of the Year." % (delta.days)

So my question is how do I call that code sniper and have it display in my home page? Yeah I could just make it javascript but that is not the exercise here. :)

After I understand that than I can go with more advance stuff which is the goal. Like have a drop listing of buildings at work and once you select a building the next field will list the floor and then rooms. After that it will show the information for that room.

Thanks

Rick R.
Light Animation Hobby - Having fun and Learning at the same time. (21st member of DLA)
You are not allowed to view links. Register or Login
Warning SOME assembly required