Skip to content

Instantly share code, notes, and snippets.

@SamarDeen
Created September 5, 2023 13:55
Show Gist options
  • Save SamarDeen/fd210f07d9e39072b019a5962ef24e4b to your computer and use it in GitHub Desktop.
Save SamarDeen/fd210f07d9e39072b019a5962ef24e4b to your computer and use it in GitHub Desktop.
The main function (simple)
import argparse
import pandas as pd
import os
def Main():
print("In the main function")
parser = argparse.ArgumentParser()
parser.add_argument("--input_folder")
parser.add_argument("--input_file_name")
parser.add_argument("--output_folder")
args = parser.parse_args()
input_folder = args.input_folder
input_file_name = args.input_file_name
output_folder = args.output_folder
print(f"input_folder is {input_folder}")
mydf = pd.read_csv(os.path.join(input_folder, input_file_name))
mydf.to_csv(os.path.join(output_folder,input_file_name))
if(__name__ == "__main__"):
Main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment