Paul's Programming Notes     Archive     Feed     Github

How To Use Endpoint Parameter - Flask-Admin

You can access the endpoint parameter by using self.endpoint.

class displayResults(BaseView):
def index(self):
print self.endpoint

admin.add_view(displayResults(name='test', endpoint='test2'))

That will print "test2".

Enable UART2 On BeagleBone Black for RS232 Cape

  1. Use this script to ensure UART2 is enabled in the device tree:
  2. Enable ttyO1 it in the firmware using this guide (makes the device appear):
  3. Put a paperclip into the RS232 port like in the picture on this page:
  4. echo hello > /dev/ttyO1
  5. cat /dev/ttyO1

Two Column Match - Flask + HandsOnTable

I'm getting more comfortable with Flask, so I decided to experiment with Google App Engine + Flask + HandsOnTable.

Here's the application I made:

It takes the contents of the 2nd column and matches it to the rows of the first column. Just press the "Match" button to see what it does.

I've found myself doing what this application does a few times, but I manually create two python lists and compare them in IDLE. This application streamlines that process quite a bit.

Here's the code:

SQLalchemy - Simple Select Query

from sqlalchemy import create_engine, MetaData, Table

engine = create_engine('sqlite:///cars.db', echo=False)
metadata = MetaData(bind=engine)

table = Table('cars', metadata)
stmt =
for row in stmt.execute():
    print row