mirror of
https://gitlab.com/cief-data/data-management.git
synced 2026-08-19 04:13:57 +00:00
auto create extract_temp_csv folder
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import csv
|
import csv
|
||||||
from operator import concat
|
from operator import concat
|
||||||
import mysql.connector
|
import mysql.connector
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
def connect_mysql(config):
|
def connect_mysql(config):
|
||||||
@@ -18,6 +19,13 @@ def connect_mysql(config):
|
|||||||
|
|
||||||
|
|
||||||
def mysql_dict_sql_to_csv(SQL_DICT, path, mysqldb, mysqlcursor):
|
def mysql_dict_sql_to_csv(SQL_DICT, path, mysqldb, mysqlcursor):
|
||||||
|
temp_folder_path = path
|
||||||
|
# Check whether the specified path exists or not
|
||||||
|
temp_folder_path_isExist = os.path.exists(temp_folder_path)
|
||||||
|
if not temp_folder_path_isExist:
|
||||||
|
# Create a new directory because it does not exist
|
||||||
|
os.makedirs(temp_folder_path)
|
||||||
|
print("[Create Folder] exchange_temp_extract_csv")
|
||||||
|
|
||||||
for tablename,sql in SQL_DICT.items():
|
for tablename,sql in SQL_DICT.items():
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user