The values of the column like “[‘a’, ‘b’]”, “[‘a’]”, “[‘c’, ‘a’]” json_each(json_column): This function is used to expand the JSON array into a set of key-value pairs, where the key is the index or key within the array, and the value is the corresponding element. So that for each record of you_table, it will expand […]
Month: December 2023
Here is an example showing
Using os.path Using pathlib (Python 3.4 or later)
SQLite does NOT have a built-in array data type. You can store a serialized representation of your array in a TEXT column. This could be a comma-separated list, a JSON array, or any other format that suits your needs. comma-separated list JSON array
SQLite does NOT have a native ENUM data type like some other database systems such as MySQL. However, you can simulate enums in SQLite using a combination of a CHECK constraint and a TEXT or INTEGER column. Here’s an example using a TEXT column: If you need to add new values to your “enum” or […]
This can be done by using the ‘opencv-python’ library. Install opencv-python Take the first frame of a video To capture a screenshot at 95% of the video duration To capture a screenshot at specific time like 3:24 Percentage to Screenshot time conversion To capture a snapshot at 95% of the video duration and then compute […]
Use os.path.getsize function
by default, when printing a Python object, it will show as an address to the object, like this contains only the class of the object (Student in the above example) and it memory address (0x10e430f65) and not much else. To display the content of the object in a nicely looked JSON format, we can overwrite […]
Can use DosBox, which is a DOS emulator that runs on Mac OS. Download Download from its official site. Choose the “Mac OS X” one. It is a dmg file, then can open the “DosBox” app inside the dmg file. Can also move it to Applications folder. Mount the Drive on DOS Mount the drive. […]