TypeError: 'int' object is not iterable - Python

前端 未结 2 550
忘掉有多难
忘掉有多难 2021-02-09 04:01

I got the following error:

  File \"/home/ec2-user/test/test_stats.py\", line 43, in get_test_ids_for_id
    cursor.execute(\"\"\"select test_id from test_logs w         


        
2条回答
  •  伪装坚强ぢ
    2021-02-09 05:00

    Basically what is happening is when you are passing a argument in query it is not becoming an iterable because it is coming in bracket. In order to make it iterable you need to make it in that form like list or tuple. Soo you can either add comma at the end (1,) or make it a list [1].

提交回复
热议问题