Created
January 14, 2019 09:26
-
-
Save nikkisharma536/064277957317ce20b42b088ac3c2d416 to your computer and use it in GitHub Desktop.
ETL project - system utility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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