Python Code Samples



Filters


how to log full traceback using python logging
kishore_kumar | 5 years, 5 months
import logging
  
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', datefmt=
python logging
convert python date time object to specific format using strftime
kishore_kumar | 5 years, 6 months
import datetime

st = "2019-08-19 05:40"
python datetime
how to extract text content from pdf file using python
kishore_kumar | 6 years
from tika import parser # pip install tika

process = parser.from_file('/path/to/my.pdf')
python tika
How to access django models in stand alone python script without manage.py
kishore_kumar | 5 years, 4 months
import os
import django

python django
Image labels detection using google Vision API in python
kishore_kumar | 5 years, 11 months
from google.cloud import vision
from google.cloud.vision import types

If you setup env variable with export GOOGLE_APPLICATION_CREDENTIALS="/file/creds.json" then you ca
python google vision
How to dump data to a pickle file in python
harika | 5 years, 4 months
X_train = []
y_train = []
with open('train.pickle', 'wb') as f:
python pickle file
Ramya
Infinite While loop example in python
Ramya | 5 years, 7 months
i = 0
while (i < 3):     
    if(i==2):
python
Ramya
While loop example in python
Ramya | 5 years, 7 months
i = 0
while (i < 3):     
    i = i+1
python
Parsing JSON file
Reshma | 5 years, 6 months
import json
x='{"a":1,"b":2,"c":3}'
y=json.loads(x)
python json parsing
get binary code for an integer in python
kishore_kumar | 5 years, 6 months
n = 115

b_n = bin(n)
python binary
Prev Next