Python Code Samples



Filters


Get User Presence of Slack user with slack api and python
kishore_kumar | 6 years, 4 months
from slackclient import SlackClient

user_token = "xoxp-2284524168-327340147858-399021736478-b7ed2
python slack-api
yogeswaran60
Basic Matrix Manipulations in Python Without Using Any Packages
yogeswaran60 | 6 years, 9 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
How to get first day of the month in python
kishore_kumar | 3 years, 8 months
from datetime import datetime

first_day = datetime.today().date().replace(day=1)
python datetime
POST request in python using requests
kishore_kumar | 6 years, 10 months
import requests

url = "https://httpbin.org/post"
url can be your API/service URL for your request.
python python-requests
durga
Finding Character in a String python
durga | 6 years, 2 months
S1=raw_input("enter String")
S2=raw_input("enter character")
S1=S1.upper() #we are changing into u
We can use lower() also, But both the strings should be changed into the same case(upper/lower).
python string in operator
convert string to python datetime object
kishore_kumar | 6 years
import datetime

st = "2019-08-19 05:40"
python datetime
get date ctime from python datetime
kishore_kumar | 6 years, 2 months
import datetime

today = datetime.date.today()
python datetime
Using python generator for finding factors
kishore_kumar | 6 years, 1 month
def get_factors(num):
    i = 1
    while i * i < num:
python generator factors
Create a line chart using python matplotlib
kishore_kumar | 6 years, 9 months
import matplotlib.pyplot as plt

t = ['12-03-18','12-04-18' , '12-05-18', '12-06-18', '12-07-18']
python matplotlib
Generate Pie Chart in python using matplotlib
kishore_kumar | 6 years, 9 months
import matplotlib.pyplot as plt

labels = 'Grapes', 'Oranges', 'Mangoes', 'Apples'
python matplotlib
Prev Next