Python Code Samples



Filters


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

print round(my_number, 2) # 123.84
python
How to access django models in stand alone python script without manage.py
kishore_kumar | 6 years, 9 months
import os
import django

python django
unzip file from gz files using python
kishore_kumar | 6 years, 8 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, 3 months
from google.cloud import vision
from google.cloud.vision import types

python google vision
convert python date time object to specific format using strftime
kishore_kumar | 6 years, 10 months
import datetime

st = "2019-08-19 05:40"
python datetime
durga
Writing into files in python
durga | 6 years, 11 months
file = open('open.txt','w') 
 
file.write('Hi there!') 
python file handling
Simple singly Linked List in python
kishore_kumar | 7 years, 4 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, 9 months
import traceback

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

str1 = "koderplace"
python base64
Remove directory / folder in python
harika | 7 years, 5 months
'''
You can remove empty directory by rmdir function.
But to remove non empty directory we have to
Shuttle : A module that offers a number of high-level operations on files and collections of files.
shutil python os
Prev Next