Category Archives: 10min

Python magic gets

  __getattribute__ and __getattr__ and __get__ and __getitem__ Lets get into these many gets. __getattr__ if the lookup attribute does not available in instance’s __dict__, then it will call __getattr__, still if it does not get, raises an AttributeError The … Continue reading

Posted in 10min, Python | Tagged , | Leave a comment

Understand __mro__

python-mro.md What is mro? method resoultion order is an algorithm to choose the right method to get executed from inherited base classes. Where it is used? mro will be interesting if more than one base class is used, the method … Continue reading

Posted in 10min, Python | Tagged , | Leave a comment

import struct – a glance

What is struct in python? struct is the python module which translates binary string to python types and vice versa. if you have any binary string which comes from network stream or anywhere can be directly translated to python types. … Continue reading

Posted in 10min, General, Python | Tagged , , | Leave a comment

Avoid duplicate process copy through cron

Scenario: You are executing a background job for every x minuts periodically.The job execution time takes approximately y mins.Sometimes y > x. So, you are endup with multiple duplicate active process running at back. Effets: If duplicate process runs at … Continue reading

Posted in 10min, Flask, Python | Tagged , , | 2 Comments

10min python: dis assembler

10min python: dis what is dis? dis is the disassembler. It shows to you how the python interpreter executes your python code in human readable format. why do we need it? To understand and optimise your python code to make … Continue reading

Posted in 10min, Python | Tagged , , | Leave a comment

10min python: settrace

10min python: what is settrace? settrace traces each execution instruction of python script Where we can use it? If you want to trace the execution sequence and it’s control over your entire script, this should be the right utility.It does … Continue reading

Posted in 10min, Academic, Python | Tagged , | Leave a comment