Python Code Samples



Filters


Ramya
PYTHON: Email Notification
Ramya | 6 years, 6 months
import win32com.client as win32
outlook = win32.Dispatch('outlook.application')
mail = outlook.Cre
outlook python
Draw subplots in matplotlib
harika | 7 years, 7 months
import matplotlib.pyplot as plt
plt.figure(1)
plt.subplot(211)
You can see the output in the attached image. If you want to play with plot then set specific prope
python matplotlib
Get User Presence of Slack user with slack api and python
kishore_kumar | 7 years, 4 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
How to combine two query sets in Django ORM
kishore_kumar | 6 years, 12 months
q1 = Task.objects.filter(id__lt=4)
q2 = Task.objects.filter(completed=True)

python django django-orm
conditional selection with numpy arrays
kishore_kumar | 7 years, 12 months
import numpy as np
ser_arr = np.arange(1,10)
mat1 = ser_arr.reshape(3,3)
numpy python
Create a dataframe in pandas with dictionary
harika | 7 years, 7 months
import pandas as pd
name_dataset = pd.DataFrame({
    "city": ["Bangalore", "Hyderabad", "Chennai"
python pandas
Python logging basic example to print from debug
kishore_kumar | 6 years, 12 months
import logging
logging.basicConfig(level=logging.DEBUG)

python logging
Python pickle dump
Reshma | 6 years, 9 months
import pickle

number_of_data = int(input('Enter the number of data : '))
python pickle dump
get date ctime from python datetime
kishore_kumar | 7 years, 2 months
import datetime

today = datetime.date.today()
python datetime
How to get number of queries executed in Django orm
kishore_kumar | 6 years, 11 months
from django.db import connection

tasks = Task.objects.all()
python django django-orm
Prev Next