tuple

    [Python] pymysql 을 통해 데이터 베이스 값(Tuple)을 List로 가져오는 법

    간단하게 크롤링 제작을 하며 데이터 베이스를 사용해 중복 제거를 할 계획이었으나 Mysql 데이터 베이스 내 데이터를 가져올 때 Tuple 형태로 가져와져 리스트화 하는데 어려움이 있었다...😓 cursor.execute("SELECT '원하는 칼럼 명' FROM 테이블 명'") target_list = [] temp = cursor.fetchall() for q in range(len(temp)): target_list.append(temp[q]) print(target_list) 위와 같은 방식으로 데이터 베이스 내 데이터를 가져온다면 쉽게 List에 넣을 수 있을 것이라고 생각하였으나 오류(TypeError tuple indices must be integers or slices not tuple)..