match

In python the equivalent to switch case in other languages is match: break There is no break in Python for match. break is only used for loops. If you want to achieve being able to break from a match case early you can use an exception trick like this:

Read More

typedef enum in Python

In C you might do this to create an automatically numbered from 0 list of values for example: In python you can do the same it with the Enum class Using Enum values

Read More

Working With Files

We use pathlib and forward slashes so that the Path() function can be used to automatically convert backslash to forward slash on Linux systems. Does file exist? Getting file name elements Delete file

Read More

Read XML

Read XML value from a XML string Read XML value from an XML file In node present? Is item empty? Item is empty if it has no text and no child elements Parse XML values from an XML file Read attribute value in a sub node

Read More

HTTP POST

Post a file Post a file from binary data I.e, POST without needing to save your data to a file first Post file and other data fields Getting the data with PHP

Read More