There are requirements at times where we have to execute the queries on the Prod database which changes the data in the table i.e insert & update queries. While inserting could be a straightforward case as the number of record is known same can't be said for UPDATE queries as the number of effected rows … Continue reading Using Python to execute MySQL Insert and Update queries
Programming Language
Create a folder in Python of Current date format
If you'd need to create a folder for current date in format as YYMMDDHH using python - You can use below code. This will create folder with "00" in hour if the time is between 00:00 to 12:00PM and from 12PM till 00:00AM, it will created folder with "12". For 2022-06-26 09:00:00 - It will … Continue reading Create a folder in Python of Current date format
Reading CSV file in python
Python's official Documentation says below thing about CSV files, The so-called CSV (Comma Separated Values) format is the most common import and export format for spreadsheets and databases. CSV format was used for many years prior to attempts to describe the format in a standardized way in RFC 4180. Reading & Writing CSV files is very … Continue reading Reading CSV file in python
Install Go 1.8 on Fedora / Ubuntu
You can follow below steps to install Go 1.8 on Fedora / Ubuntu. (It should work for other Linux distribution as well but it is only tested for Ubuntu / Fedora). Step 1: Download the Go 1.8 bundle by clicking here. Step 2: Extract the downloaded bundle using below command, Step 3: Add below to your … Continue reading Install Go 1.8 on Fedora / Ubuntu
Django – AttributeError: ‘Http404’ object has no attribute ‘status_code’
If you getting this error, it might be because you are returning Http404 instead of raising it. you need to raise django.http.Http404, not return it. example code :
PHP cURL
cURL Requests with PHP CURL is a way you can hit a URL from your code to get a HTML response from it. cURL means client URL which allows you to connect with other URLS and use there responses in your code. Introduction cURL allows transfer of data across a wide variety of protocols, and … Continue reading PHP cURL
Python Decorators
In August 2009, I wrote a post titled Introduction to Python Decorators. It was an attempt to explain Python decorators in a way that I (and I hoped, others) could grok.
Recently I had occasion to re-read that post. It wasn’t a pleasant experience ? it was pretty clear to me that the attempt had failed.
That failure ? and two other things ? have prompted me to try again.
- Matt Harrison has published an excellent e-book Guide to: Learning Python Decorators.
- I now have a theory about why most explanations of decorators (mine included) fail, and some ideas about how better to structure an introduction to decorators.
There is an old saying to the effect that “Every stick has two ends, one by which it may be picked up, and one by which it may not.” I believe that most explanations of decorators fail because they pick…
View original post 1,457 more words