by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Introduction Use git grep to search code within the git repo. It makes it very convenient and efficient to do code searches without leaving your terminal (or editor). Setup Git Repo Setting up a sample git repo to play with git grep. git init someproject cd...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Simple HTTP server This server can be used to serve HTML files. # Python2 python -m simplehttpserver # Python3 python3 -m http.server python3 -m http.server 8080 python3 -m http.server 8080 –bind 127.0.0.1 Simple CGI server # Python2 python -m CGIHTTPServer #...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
Parsing JSON import json data = json.loads(json_string) Dumping complex structures import json print json.dumps(something) Convert YAML to JSON import yaml, json with open(‘./file.yaml’) as f:...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
chr, ord, and ascii, are built-in functions in the Python programming language. They are used to convert and represent characters and strings, specifically Unicode and ASCII character sets. chr This function returns a string representing a character whose Unicode code...
by Pranav Kulkarni | Nov 24, 2023 | Uncategorized
To retrieve data received in a Flask request, you can use the following attributes available on the request object: from flask import request request.args: This attribute contains the key/value pairs from the URL query string. You can access them...