Python Code Samples



Filters


Get system hostname using python
kishore_kumar | 4 years, 6 months
import socket
print(socket.gethostname())

python socket
Threading in python basic example - create a Thread
kishore_kumar | 6 years, 9 months
import threading
import time

python threading
Python pandas dataframe select two records for each value of a column using group by
kishore_kumar | 4 years, 2 months
df = pd.DataFrame({'id':[1,1,1,2,2,2,3,3,3,4,4,4], 'value': ['one','two','three','one','two','three'
python dataframe
How to get image width and height using python
kishore_kumar | 6 years, 1 month
from PIL import Image

im = Image.open('my_image.png')
python python-pil
Ramya
PYTHON: Random Password Generator
Ramya | 5 years, 6 months
import random
import string
def randomPassword(stringLength):
random python
Send message to user in slack with python and slack api
kishore_kumar | 6 years, 9 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
How to check given date comes under given cron schedule in python
kishore_kumar | 5 years, 11 months
# pip install croniter

import datetime
python croniter crontab
How to get full path of python module file and directory
kishore_kumar | 6 years, 1 month
import os

if __name__ == '__main__':
python python-os
Ramya
PYTHON: Email Notification
Ramya | 5 years, 6 months
import win32com.client as win32
outlook = win32.Dispatch('outlook.application')
mail = outlook.Cre
outlook python
Python get last working day of the month
kishore_kumar | 3 years, 10 months
from datetime import datetime
import calendar

python datetime
Prev Next