Python Code Samples



Filters


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

python django
convert python date time object to specific format using strftime
kishore_kumar | 5 years, 8 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, 2 months
from tika import parser # pip install tika

process = parser.from_file('/path/to/my.pdf')
python tika
send mail using sendgrid python
kishore_kumar | 5 years, 9 months
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
python sendgrid
Image labels detection using google Vision API in python
kishore_kumar | 6 years, 2 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, 7 months
X_train = []
y_train = []
with open('train.pickle', 'wb') as f:
python pickle file
Ramya
While loop example in python
Ramya | 5 years, 9 months
i = 0
while (i < 3):     
    i = i+1
python
Ramya
Infinite While loop example in python
Ramya | 5 years, 9 months
i = 0
while (i < 3):     
    if(i==2):
python
Parsing JSON file
Reshma | 5 years, 9 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, 9 months
n = 115

b_n = bin(n)
python binary
Prev Next