Python Code Samples



Filters


round a floating point number in python
kishore_kumar | 7 years, 5 months
my_number = 123.83725

print round(my_number, 2) # 123.84
python
unzip file from gz files using python
kishore_kumar | 6 years, 7 months
import gzip
import shutil
with gzip.open('my_file.gz', 'rb') as f_in:
python gzip
Text identification in the image using google vision API with python
kishore_kumar | 7 years, 1 month
from google.cloud import vision
from google.cloud.vision import types

python google vision
How to access django models in stand alone python script without manage.py
kishore_kumar | 6 years, 7 months
import os
import django

python django
durga
Writing into files in python
durga | 6 years, 9 months
file = open('open.txt','w') 
 
file.write('Hi there!') 
python file handling
convert python date time object to specific format using strftime
kishore_kumar | 6 years, 9 months
import datetime

st = "2019-08-19 05:40"
python datetime
Simple singly Linked List in python
kishore_kumar | 7 years, 2 months
class Node(object):
    def __init__(self, data=None, next_node=None):
        self.data = data
python linked list
Save full traceback from exception in python
kishore_kumar | 6 years, 8 months
import traceback

l = [1,2,3]
python exception
python base64 encode and decode a string
kishore_kumar | 6 years, 10 months
import base64

str1 = "koderplace"
python base64
get all keys from redis with python
kishore_kumar | 6 years, 5 months
import redis # pip install redis
r = redis.Redis(host='localhost', port='6379')

python redis
Prev Next