아미(아름다운미소)

How to check the existence of a row in SQLite with Python? 본문

랭귀지/PYTHON

How to check the existence of a row in SQLite with Python?

유키공 2018. 11. 5. 18:24

Python으로 SQLite에서 행의 존재를 확인하는 방법

row = cursor.fetchone()
if row is None:
  ... # row is not present
else:
  ... # row is present

simple

row = cursor.fetchone()

if row:
  print "row is present"
else:
  print "row is not present"


Comments