Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. import subprocess
  2.  
  3. tables = [
  4. "Dictionary_codi",
  5. "Dictionary_item",
  6. "NFC_hits",
  7. "album",
  8. "apply",
  9. "banner",
  10. "board_comment",
  11. "brand_sendinfo",
  12. "calculate",
  13. "calculate_item",
  14. "cancel_info",
  15. "card_info",
  16. "category",
  17. "codi_history",
  18. "comment",
  19. "contract",
  20. "coordinate",
  21. "dailycodi",
  22. "designer_code",
  23. "em_banlist",
  24. "em_mmt_log_table",
  25. "em_mmt_tran",
  26. "enquire",
  27. "eventBoard",
  28. "faq",
  29. "faq2",
  30. "friend",
  31. "hashtag",
  32. "hashtag_list",
  33. "hits",
  34. "item",
  35. "item_evaluation",
  36. "itembrand",
  37. "itemcategory",
  38. "itemcolor",
  39. "kakao_msg",
  40. "like_user",
  41. "likehistory",
  42. "master_app_info",
  43. "notice",
  44. "order_basket",
  45. "order_error",
  46. "order_history",
  47. "order_info",
  48. "order_item",
  49. "order_log",
  50. "point_history",
  51. "push",
  52. "question",
  53. "ranking",
  54. "recommend",
  55. "recommend_codi",
  56. "recommend_hashtag",
  57. "recommend_log",
  58. "recommend_statistics",
  59. "reservecode",
  60. "sample",
  61. "search",
  62. "server_service",
  63. "storage",
  64. "test_item",
  65. "urlcodemap",
  66. "user",
  67. "user_leave",
  68. "vuser_leave"]
  69.  
  70. command = ["mysql", "-B", "--host=SECRETESTAISFOAUAG", "--user=SECRETESTAISFOAUAG", "--password=SECRETESTAISFOAUAG", "mapssiDB"]
  71. command = " ".join(command)
  72. print(command)
  73. input = 'select * from '
  74.  
  75. for table in tables:
  76. with open(table+".csv","w") as f:
  77. p = subprocess.Popen(command, stdout=f,stdin=subprocess.PIPE,shell=True)
  78. p.communicate(input=input+table)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement