OS

In [8]:
import os
from sys import platform

lpad_path = os.curdir
os.chdir(lpad_path) if "win" in platform.lower() else ''
os.chdir(lpad_path)
str_path = lpad_path + '\\newfolder'
if not os.path.exists(str_path):
    os.mkdir('newfolder')
os.chdir('newfolder')
In [3]:
table_to_csv = ['IM_LAUNCHPAD_REPORT_INFO']
for i in table_to_csv:
    query = "select * from " + i + " where delivery_id='" + delivery + "'"
    df = read_sql(query, CONN)
    df.to_csv(i+'.csv')
    utility.log_time('created csv '+i)
Out[3]:
'.'
www.000webhost.com