How to Iterate through cur.fetchall() in Python

前端 未结 5 899
刺人心
刺人心 2021-01-02 18:18

I am working on database connectivity in Python 3.4. There are two columns in my database.

Below is the query which gives me all the data from two columns in shown f

5条回答
  •  借酒劲吻你
    2021-01-02 18:53

    To iterate through this: [('F:\test1.py', '12345abc'), ('F:\test2.py', 'avcr123')]

    Code:
    for i in data:
       print i[0] + '\t' + i[1]
    

    Output:

    F:\test1.py 12345abc
    F:\test2.py avcr123

提交回复
热议问题