Note: For non-members, this article is also available at https://dineshkumarkb.com/tech/package-data-files-to-pyinstaller-binaries/
I am sure most of you would have used pyinstaller for generating executables. This article does not cover what a pyinstaller is. However, the focus of the article will be on how to add external data files to your pyinstaller binaries and their use cases.
Usually, we generate a one file executable in pyinstaller using the following command.
$pyinstaller --onefile --clean <file_name.py>
Let’s say you have a help file for your application which needs to be packed along with your executable. …
Note: For non-members, this article is also available at https://dineshkumarkb.com/tech/meet-ochrona-an-application-to-validate-your-dependencies/
Security in your code is considered to be of paramount importance today, especially when we work remotely. We do a lot of proof-of-concepts, implement business logic with multiple libraries. Though most of them are open source, there could be vulnerabilities, license issues when we productize the code for commercial use. It is almost impossible to keep an eye on every single library and their possibility for commercial use. That’s why we have vulnerability scanners to make lives easier.
Ochrona security provides solution for validating dependencies of your python project.
Note: For non-members, this article is also available at https://dineshkumarkb.com/tech/display-markdown-text-in-command-line-using-python/
Recently, I was given a task of refactoring our legacy command line application. I was thinking what more could we do to improvise a legacy command line application that’s working just fine.
Remembering the commands and their respective flags, optional parameters etc is bit hectic. Of course you could copy all the commands in a notepad and use ’em as needed. But that’s still annoying if you ask me.
So what did I do?
I came across this library called PyInquirer and
rich with which we could make colorful command…
Note: For non-members, this article is also available at https://dineshkumarkb.com/tech/build-command-line-applications-in-python-using-rich/
Do you want to get over the regular monochrome command line? Interested in building visually appealing clis? …Or want to showcase your cli with cool enhancements? If you have any of these on your mind, then you should definitely try using python’s
Rich works on OSX, linux and windows platforms
≥ Python 3.6.1
pip install rich
Rich is a Python library for writing rich text (with color and style) to the terminal, and for displaying advanced content such as tables, markdown, and syntax highlighted code.
Note: For non-members, story is available here .
This article explains how to delete the nth node of a linked list from the end provided the head of the linked list. This is similar to getting the nth
node from the end of the
linked list. This is one of the problems in .
This article explains how to get the nth node of a linked list from the end provided the head of the linked list. So why from the end and not the head? Finding the nth node from the beginning is pretty straightforward.Isn’t it? This could be asked in interviews and this is also available in cracking the coding interview.
So, Let’s cut to the chase.
Note : For non-members, this story is available here.
Any code is readable only when it is written with proper comments. Do you agree?Having said that a developer’s task does not end with just writing code. The maintainability factor kicks in immediately after the code gets into production. Your code is maintainable if it answers the following questions.
For obvious reasons, the author of the code shouldn’t answer these questions. Your peer should answer them for you. Or if you don’t wanna be your own judge the best…
This article describes how to implement a sliding window using python. A sliding window is a subset of a data structure at a given point of time. The window size decides the number of elements in the subset.
Let’s take an example of a list with 8 elements as below.
Note: This article was originally published on my personal blog
As a Pythonista, we all know where to specify our project dependencies. The
requirements.txt file traditionally contains all the project dependencies. The specified libraries from this file will be installed from the
requirements.txt looks like this.
When you say
pip install -r requirements.txt, pip by default looks into the PyPI repository for the libraries mentioned in
So now comes the question.
What if you want to install a library that is hosted on a repository other than
PyPI. This could be…