Concept

Using Functions for Dependency Injection and as Callback in Python

Although implementing Dependency Injection design pattern and Callbacks can be implemented in most programming languages (even in VB6), it’s just cleaner/neater to do in Python. These are also scenarios or use cases where you intentionally would pass the function object instead of it’s return value. Function as dependency To write a function that behaves differently …

Using Functions for Dependency Injection and as Callback in Python Read More »

When to and Why Use Parentheses in Python

One of the important (and usually confusing) concepts a developer needs to understand in Python is the use (or omission) of parentheses. This may seem so trivial, even obvious but it’s something that can cause problems to a lot of programmers, especially new ones coming from a different programming language. At best it could cause …

When to and Why Use Parentheses in Python Read More »

Python Environments

If you’re working on different projects, especially large projects, you should be using Python Environments. So what is a Python Environment and why should I care? The best definition is the one from the official documentation: The venv module provides support for creating lightweight “virtual environments” with their own site directories, optionally isolated from system site directories. …

Python Environments Read More »

Try..Catch… … in VB6?

If you’ve been using VB.Net or any modern programming languages, you’ve probably used Try..Catch (or try..except) when performing routines that could potentially fail. But in the classic Visual Basic 6.0 language, there is no such construct… right? Technically there’s none…but…there is a way to mimic that behavior — or at least the mechanism using pure/native …

Try..Catch… … in VB6? Read More »

Python Course Syllabus

If I’m going to create my own Python Tutorial Course, here’s what I’d probably use as course syllabus: Basics hello, world operators & expressions variables & scope data types type casting data structures value comparison multiple assignment comments user input output formatting indentation decision making (branching) error handling Intermediate function loop args & kwargs importing …

Python Course Syllabus Read More »

Generate Temporary Password using Python

Today we’re going to create a function that you can use in your applications that involves giving users temporary password. It’s not limited to password generation though, you can use this function to generate a meal ticket or transaction number, etc. By the way, this assumes you have read the previous blog. If not, here’s …

Generate Temporary Password using Python Read More »