How to typed command line arguments in python Creating tools with python is a common practice due to its ease of use and productivity. Now python already has good built-in support for parsing command-line arguments, but we can take it one step further. Let’s take the following example where we...
How to call a function of a file in python Take the following use case, where I have a script that I use in my Continues Integration (CI) pipeline and I would like to call a function in that file from the command-line with parameters. The inspect module provides several useful functions to help get...
Practical cppstd 17 highlights by example Language Features Library Features Language Features Nested namespace definitions namespace A::B::C { // ... } // Rather than: namespace A { namespace B { namespace C { // ... } } } Structured bindings #include <map> #include <string> #include...
The standard library std::variant is a usefull feature, introduced since c++17, to define a type that can hold multiple alternative types. For example a cell of a CSV file could represent multiple data types such as a string or int. Declaring a new type std::variant<std::string, int> allows to...