Python Code Samples



Filters


sindhuja
Install SQL using Ansible
sindhuja | 6 years, 9 months
---
#give the IP address of the hosts you want to install SQL
- hosts: XXXX
ansible
Get system hostname using python
kishore_kumar | 4 years, 1 month
import socket
print(socket.gethostname())

python socket
How to get image width and height using python
kishore_kumar | 5 years, 8 months
from PIL import Image

im = Image.open('my_image.png')
python python-pil
Ramya
PYTHON: Random Password Generator
Ramya | 5 years, 1 month
import random
import string
def randomPassword(stringLength):
random python
Send message to user in slack with python and slack api
kishore_kumar | 6 years, 4 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, 6 months
# pip install croniter

import datetime
python croniter crontab
Python pandas dataframe select two records for each value of a column using group by
kishore_kumar | 3 years, 10 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
Ramya
PYTHON: Email Notification
Ramya | 5 years, 1 month
import win32com.client as win32
outlook = win32.Dispatch('outlook.application')
mail = outlook.Cre
outlook python
yogeswaran60
Basic Matrix Manipulations in Python Without Using Any Packages
yogeswaran60 | 6 years, 4 months
#Matrix Manipulations Without using any packages
#Define Matrix A,B,C 
A=[[1,2,3],
Change the result matrix dimension according to Matrix Dimensions properties Product of (M*N) and (
python matrix
Get User Presence of Slack user with slack api and python
kishore_kumar | 5 years, 11 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
Prev Next