How to get File System’s separator using Python
How to get FileSystem’s separator using Python Home / problem You’re writing a program (e.g. AWS lambda) in Python that is using a file path and runs on various Operating Systems. For example, Windows OS uses a different separator in comparison with Mac OS. Operating System File Path example Windows C:DocumentsNewslettersSummer2018.pdf Mac OS /home/user/documents SOLUTION […]
How to add a video in HTML
How to add a video in HTML Home / 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 […]
Writing to a file in Python
Writing to a file in Python Home / 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 […]
Read a file in Python
Read a file in Python Home / 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 […]