Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Schedule Archiving a Folder Daily with Specific Time in Python App?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 20
    Answer it
    def zipdir(path, ziph):
     #ziph is zipfile handle
     for root, dirs, files in os.walk(path):
        for file in files:
            ziph.write(os.path.join(root, file))
            zipf = zipfile.ZipFile('test_python.zip', 'w', 
            zipfile.ZIP_DEFLATED)
            zipdir('./test_python', zipf)
    
     schedule.every().thursday.at("11:25").do(zipdir) // **here is the error**
    
     while True :
        schedule.run_pending()
        time.sleep(1)

     

    I get this error: the first argument must be callable, how can I fix it?

     

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: