Skip to content

Check the presence of files within directory

under “mypath” i have one folder and under this folder i have files and i want to check the existance of files under this folder, but in my example below it checks only the directory where is the folder (where there is no files) , So any idea? Answer You need to check the right directory: Like @td…

Run task from another periodic task with celery

I have periodic task which should trigger another task. Final expected behavior: first task should collect some data from external service and then loop over this data (list) and call another task with passing over argument (current iteration in loop). I want to have those tasks in loop being asynchronical. I…

How to generate random number by given string in python?

As hash function gives different values in different python interpreters , Is there a more stable one in python ? Update one: “stable” means that the function should give the same number when the string is same anytime. hash can’t do it . I want a function like : For example , generate_rando…

Datetime Timezones from String

I am trying to figure out how to make a datetime object aware through using a variable. I grab the timezone of the user and pass it through a form to be used. I have tried both of the below methods and am not having much success This will then give me errors of TypeError: tzinfo argument must be None