Python Programming Python Code Samples



Filters


How to get the master IP Address of EMR Cluster
Reshma | 5 years, 10 months
import os
import boto3
session = boto3.Session(profile_name='aws_profile_name')
python aws ipaddress
Usage of Operator functions instead of lambda functions
harika | 6 years, 4 months
import functools
import operator
list = [1, 2, 3, 4, 5]
Both lines generates the same result
lambda operator python
How to connect to PostgreSQL database and display list of tables in python
kishore_kumar | 6 years, 3 months
import psycopg2

conn = psycopg2.connect(host="localhost", database="mydb", user="kishore", passwo
python psycopg2 postgresql
fetch all documents from mongo db collection using python
kishore_kumar | 6 years, 3 months
import pymongo

client = pymongo.MongoClient("mongodb://localhost:27017")
pymongo python mongodb
json string to python dictionary using json module
kishore_kumar | 6 years, 7 months
import json

my_str = '{"1": 4, "4": 2, "5":3 }'
python json
Ramya
Difference between normal def defined function and lambda function in Python
Ramya | 5 years, 11 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
sandeep
Python Script to create AWS beanstalk
sandeep | 7 years
#!/usr/bin/python
  
import boto
python aws beanstalk
Get current environment variables in python
kishore_kumar | 7 years
import os
env = os.environ

python python-os
Ramya
PYTHON: AWS IAM password reset
Ramya | 5 years, 4 months
import boto3
client = boto3.client('iam')
UserName=input("Enter UserName:")
boto3 python
gaya38
Shuffle list elements in python
gaya38 | 6 years, 9 months
import random;
z = [1,90,4,2]
z = random.shuffle(z)
python
Prev Next