Rosh PR

Just blog

Category

Python

Argparse: adding sub commands to your command line arguments

Use argparse to add support for command line arguments to your program. Argparse supports adding sub commands to a primary command. It also supports making your subcommands mandatory or optional. Let me jump into example & explain. import argparse, sys… Continue Reading →

Python: Pass by reference

One of the most confusing aspect for Java programmers in understanding Python is Pass by Reference. I have consolidated some of the example below for easier understanding How do I pass a variable by reference? class PassByReference: def __init__(self): self.variable… Continue Reading →

Python : String as immutable type

Many of them moving from Java to Python get confused with the way Python string immutability work. I have put down a compilation of different example I found to help you understand the same. The variable a is pointing at… Continue Reading →

Creating simple dynamic loading Python plugin model

To create a simple plugin framework in python we will be using the following features in Python Abstract Base Class : abc Dynamic module import : __import__ Use case: Create a plugin framework for loading dynamic model classes that will… Continue Reading →

© 2024 Rosh PR — Powered by WordPress

Theme by Anders NorenUp ↑