Tag Archives: Python

Singly Linked List in Python

I was reading about data structures this evening and I worked out simple singly linked list. The neat thing about this implementation is that a I made it iterable, also. I’d originally wanted to provide a minimal working singly linked list, and then add features and testing with explanations, but it’s been a long day. This example assumes that you’re using Python2.7; version 3 provides a __next__ class method.

Continue reading

Use Vagrant to Manage an OEL6 Virtual Machine

Vagrant is a tool that you can use to set up, configure, and access a VM through the command line. This is a life changer. I love it. In this post I’ll walk through setting up an OEL6 virtual machine, installing a non-ancient version of Python, and configuring the port forwarding so that you can use it for backend web development. (The port forwarding is not obvious on RHEL/OEL.)

Continue reading

Using Sessions in Flask

In this post I’ll provide an example of using session management in Flask. This is useful when you need to recover persistent data across different endpoints in your application. In this example, we set the permanent attribute of the session object to True in order to ensure that the session data lasts indefinitely until it is cleared when the user accesses the root endpoint again. The best practice is to have a timeout on the session data.

Continue reading