Skip to content

Instantly share code, notes, and snippets.

@nikkisharma536
Created January 14, 2019 09:26
Show Gist options
  • Select an option

  • Save nikkisharma536/064277957317ce20b42b088ac3c2d416 to your computer and use it in GitHub Desktop.

Select an option

Save nikkisharma536/064277957317ce20b42b088ac3c2d416 to your computer and use it in GitHub Desktop.
ETL project - system utility
import subprocess
import os
import uuid
def execute_local(args):
print('running command : %s' % ( ' '.join(args) ))
process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = process.communicate()
print('STDOUT:{}'.format(output))
def del_local_file(list_of_file):
for file in list_of_file:
print("Removing file from local")
os.remove(file)
def read_file(path):
content = open(path, "r")
return content.read()
# Create random uuid generator
def generate_uuid():
return str(uuid.uuid1())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment