Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- tables = [
- "Dictionary_codi",
- "Dictionary_item",
- "NFC_hits",
- "album",
- "apply",
- "banner",
- "board_comment",
- "brand_sendinfo",
- "calculate",
- "calculate_item",
- "cancel_info",
- "card_info",
- "category",
- "codi_history",
- "comment",
- "contract",
- "coordinate",
- "dailycodi",
- "designer_code",
- "em_banlist",
- "em_mmt_log_table",
- "em_mmt_tran",
- "enquire",
- "eventBoard",
- "faq",
- "faq2",
- "friend",
- "hashtag",
- "hashtag_list",
- "hits",
- "item",
- "item_evaluation",
- "itembrand",
- "itemcategory",
- "itemcolor",
- "kakao_msg",
- "like_user",
- "likehistory",
- "master_app_info",
- "notice",
- "order_basket",
- "order_error",
- "order_history",
- "order_info",
- "order_item",
- "order_log",
- "point_history",
- "push",
- "question",
- "ranking",
- "recommend",
- "recommend_codi",
- "recommend_hashtag",
- "recommend_log",
- "recommend_statistics",
- "reservecode",
- "sample",
- "search",
- "server_service",
- "storage",
- "test_item",
- "urlcodemap",
- "user",
- "user_leave",
- "vuser_leave"]
- command = ["mysql", "-B", "--host=SECRETESTAISFOAUAG", "--user=SECRETESTAISFOAUAG", "--password=SECRETESTAISFOAUAG", "mapssiDB"]
- command = " ".join(command)
- print(command)
- input = 'select * from '
- for table in tables:
- with open(table+".csv","w") as f:
- p = subprocess.Popen(command, stdout=f,stdin=subprocess.PIPE,shell=True)
- p.communicate(input=input+table)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement