How to add a video in HTML

How to add a video in HTML problem You’re learning HTML and wish to place a video item on your page. In this post we will see how to load and play a video from a local video file and remotely via a URL. SOLUTION Using the <video> tag. It has an opening and closing […]

Writing to a file in Python

Writing to a file in Python problem In a program, the data are stored in memory (RAM) and are volatile. In this post we will see how to save (persist) some data so the program can later load them. The data will be stored in a text file. SOLUTION In Python, we can write to […]

Read a file in Python

Read a file in Python problem You’re learning Python and wish to use the file system in your program. With files we can retrieve information from our machine, load it in our program and manipulate it as we like. With a file we can persist data. SOLUTION Let’s suppose we have the following text file. […]