Python Code Samples



Filters


Matrix transpose using list comprehensions in python
harika | 7 years
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
Get current environment variables in python
kishore_kumar | 7 years, 8 months
import os
env = os.environ

python python-os
How to get the list of available files in S3 instead of getting the folders using boto3?
Reshma | 6 years, 3 months
import boto3

client = boto3.client('s3', aws_access_key_id="aws_access_key",
boto3 python list of files in s3
Ramya
Finding usage of the file system in linux using python
Ramya | 6 years, 2 months
import subprocess
threshold = input("Enter the threshold value:")
child = subprocess.Popen(['df','
python linux subprocess
gaya38
Shuffle list elements in python
gaya38 | 7 years, 5 months
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, 7 months
from contextlib import contextmanager
import datetime

python azure
gaya38
Python sample codes for beginners
gaya38 | 7 years, 6 months
print "Welcome to python"
Basic python programs available in below links which will covers most of the examples of Level 1 pyt
python
Use map function in python
kishore_kumar | 7 years, 6 months
def get_double(num):
    return num * 2

python
Convert yaml / yml file contents to python dictionary object
kishore_kumar | 6 years, 7 months
import yaml

with open('sample.yaml') as f:
python yaml yml
Ramya
PYTHON: AWS IAM password reset
Ramya | 6 years
import boto3
client = boto3.client('iam')
UserName=input("Enter UserName:")
boto3 python
Prev Next