<gh_stars>0
import os
import pandas as pd
import csv

def write_output_txt(results_dict, output, thread_num):

    for result_name in results_dict.keys():
        output_name = result_name[:-4] + '_out.txt'
        output_path = os.path.join(output, output_name)

        if not os.path.exists(output):
            os.makedirs(output)

        with open(output_path, 'w') as f:
            f.write(results_dict[result_name])


def write_output_csv(result_dict, output, thread_num):
    
    output_path = os.path.join(output, 'output.csv')

    with open(output_path, 'w', encoding='utf-8-sig') as f:
        wr = csv.writer(f)

        for k, v in result_dict.items():
            wr.writerow([k, v])

    #df = pd.DataFrame(result_dict)
    #df.to_csv(output_path, index=False)

if __name__ == '__main__':
    pass