Python Code Samples



Filters


Ramya
Difference between normal def defined function and lambda function in Python
Ramya | 6 years, 3 months
li = [4,65,65,23,86,343,75,3,7,5,87,34,56,64,90] 
final_list = list(filter(lambda x: (x%2 == 0) , l
lambda python
Matrix transpose using list comprehensions in python
harika | 6 years, 8 months
a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
#Procedure1:--------
transposed = [[row[i] for row in a ] fo
List comprehensions in python basically reduce the loc. Check the difference between two procudures
python matrix list
sandeep
Python Script to create AWS beanstalk
sandeep | 7 years, 4 months
#!/usr/bin/python
  
import boto
python aws beanstalk
Get current environment variables in python
kishore_kumar | 7 years, 4 months
import os
env = os.environ

python python-os
find all numbers in a string using python regular expression
kishore_kumar | 6 years, 3 months
import re

inp_st = "This 1 line has 100 number, 34 and 90s two"
re python string
gaya38
Shuffle list elements in python
gaya38 | 7 years, 1 month
import random;
z = [1,90,4,2]
z = random.shuffle(z)
python
Get records from azure sql table as python dictionary
kishore_kumar | 6 years, 3 months
from contextlib import contextmanager
import datetime

python azure
Ramya
PYTHON: AWS IAM password reset
Ramya | 5 years, 8 months
import boto3
client = boto3.client('iam')
UserName=input("Enter UserName:")
boto3 python
Use map function in python
kishore_kumar | 7 years, 2 months
def get_double(num):
    return num * 2

python
Ramya
Finding usage of the file system in linux using python
Ramya | 5 years, 10 months
import subprocess
threshold = input("Enter the threshold value:")
child = subprocess.Popen(['df','
python linux subprocess
Prev Next