Step by step guide to python decorators and how to use them
So you are reading this post which means you already have some knowledge about python and some vague ideas about decorators. Let’s walk through this article, we hope your idea about decorator will be much more solid by the end of this article. bonus we will try to create the decorator “app.route(‘/’)” you used to see in Flask from scratch.
So what is a decorator and why do we need this?
Decorators as the name suggests are a way to decorate any python object and replaces the old…
Discussion on WSGI and possible way to make node.js server WSGI compliant
The beauty of Python web frameworks is that they are WSGI compliant and there are many servers that are also WSGI compliant like
mod_wsgi etc. The full list can be found here.
This makes the whole system modular, a server that can talk WSGI can be replaced with any other WSGI-compatible servers. Similarly, a web framework that understands WSGI can be replaced with any other framework.
Let’s start with this question, what do you think will be the answer? Will it print
1 100 to the console? If yes, then congratulations my friend, we will be having a great journey for the rest of the article. If you think it will be
1 1 then, please suggest a good time, I want to learn a thing or two from you 😁.
So what is Lexical Environment? In a simple term, the lexical environment is an area where variables and are defined. You can think of a group where variables are defined.
Well yes, not so powerful as Jupyter Notebook, but close one with only Python, some of its standard libraries, and Flask. I have named it Pluto Notebook because it is a very tiny version of Jupyter Notebook! The GitHub link for the project can be found here. I have created a youtube video describing how to do it, make sure to check it out here.
I was doing a project for which I needed to do MAC whitelisting to my TPLink router. The only way to do that was through TPLink webpage at 192.168.0.1.
So I wrote a python module so that I can use it to control my router. It is very well documented.
Before using the module make sure you have installed python
Download or clone the file from https://github.com/epsi95/TPLink-Python
You can see a file named tplink_python.py
Place it in your directory where is your python file is, and then import it as
from tplink_python import TPLinkClient
To start using it
A mechanism to share personal wifi connection
I have a project idea where I want to sell my wifi 😛. Since most of the time I don’t stay at home, my wifi is underutilized. How can I sell it? It turns out that TPLink router has this capability of MAC filtering. So if someone wants to use my wifi for one day, I can “whitelist” his/her MAC address for 24 hours. After that I will remove it, so the person won’t be able to access it.
Here is the block diagram that I have in mind —
An introduction on how to use Here SDK in Flutter
Here you can find Here official documentation.
Login to your Here developer account and create Create a project if you haven’t already. Next, create credentials for Flutter and download the SDK. It’s completely free for personal projects.
An effort to demystify Python object referencing mechanism
Long time back I posted one question on StackOverflow
It seems foo_1() was not able to modify the variable but foo_2() was. People may think that since some_variable is an int that is why it is passed by value and some_list is a list(or vector) that is why it is used as a reference.
Does python do all these under the hood? How does Python know when to call by value and when to call by reference?
I heard some guys on Twitter saying Python function works by call by reference mechanism…
We can implement animation using SingleTickerProviderStateMixin mixin in Flutter. But simple_animation package provides a clean way to make animations.
The animation will look like
When the button is pressed, two things will happen