Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySql - Loop - CHeck File
#2
As the error message says, your indentation is messed up.
Only use 4 spaces for each indentation, DO NOT USE TABS.
Set up your IDE, text editor, whatever you use, to insert 4 spaces if you press TAB key.
def clean_db():
    cur.execute("SELECT file FROM detection")
    result = cur.fetchall()
    for row in result:
        if os.path.exists(row[0]):
            print(row[0])
Reply


Messages In This Thread
MySql - Loop - CHeck File - by gcclinux - Nov-30-2019, 11:43 AM
RE: MySql - Loop - CHeck File - by ThomasL - Nov-30-2019, 11:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to automate loop test check on Network device jpc230 1 634 Oct-09-2023, 09:54 PM
Last Post: Larz60+
  Mysql and mysql.connector error lostintime 2 754 Oct-03-2023, 10:25 PM
Last Post: lostintime
  please check this i wanna use a csv file as a graph xCj11 5 1,564 Aug-25-2022, 08:19 PM
Last Post: deanhystad
  check if a file exist on the internet and get the size kucingkembar 6 1,867 Apr-16-2022, 05:09 PM
Last Post: kucingkembar
  Mysql error message: Lost connection to MySQL server during query tomtom 6 16,390 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  Code to check folder and sub folders for new file and alert fioranosnake 2 2,003 Jan-06-2022, 05:03 PM
Last Post: deanhystad
  Check last time file was accessed Pavel_47 4 2,889 Jun-01-2021, 05:47 PM
Last Post: Yoriz
  How to check if a file has finished being written leocsmith 2 7,983 Apr-14-2021, 04:21 PM
Last Post: perfringo
  Need Help with connecting to mysql from txt file kingceasarr 4 3,378 Mar-24-2021, 05:42 AM
Last Post: buran
  I want to check if the input is str or is int & if it's str repeat the loop HLD202 4 2,853 Nov-23-2020, 11:01 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020