Reading Time: 1 minutesDetecting platform in Python using sys.platform Detecting platform in Python using sys.platform The builtin sys module provides a very useful attribute called platform, which can be used to execute separate […]
Python
Encoding in Python: encode() & decode()
Reading Time: 1 minutesEncoding in Python - encode() & decode() Encoding in Python - encode() & decode() Encoding, is the process of transforming the string into a specialized format for efficient storage or […]
Python: Number System Interconversion - int(), bin(), oct() & hex()
Reading Time: 1 minutesNumber System Interconversion in Python Number System Interconversion in Python Python provides handy builtin functions bin(), hex() & oct() to convert decimal values to strings of corresponding number systems. To […]
Python: Call functions upon termination of program
Reading Time: 1 minutesCall functions upon termination of program in Python Call functions upon termination of program in Python The builtin module atexit helps to call functions upon normal termination of Python scripts. […]
Python: Naming Slices for Cleaner Code
Reading Time: 1 minutesNaming Slices in Python Naming Slices in Python The constructor of the builtin slice class creates a slice object, which can be used in places where a slice is normally […]
IPython: An enhanced interpreter
Reading Time: 2 minutesIPython in Python IPython in Python IPython is a third-party interactive interpreter which has an array of features lacking in the original interactive interpreter of Python. It provides a browser-based […]
Python: When to use repr() & str() functions
Reading Time: 1 minutesrepr() & str() in Python repr() & str() in Python The builtin repr() function returns a string containing the printable representation of an object. Each Python object, be it lists, […]
Python: Collecting arguments passed to a Python script
Reading Time: 1 minutesCollecting arguments passed to a Python script Collecting arguments passed to a Python script The builtin sys module exposes objects used or maintained by the Python interpreter. One of these […]
Python: Getting size of an object in memory
Reading Time: 1 minutesGetting size of an object in memory in Python Getting size of an object in memory in Python The getsizeof() function of sys module tells us about the size of […]
Object Oriented Python: Using the __str__() magic method
Reading Time: 1 minutesUsing __str__() in Python Using __str__() in Python Like the __init__() method, the __str__() method is one of several class methods which are called implicitly on certain events. These methods […]

