Improve this answer. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. This is not exactly what your original code does, but I'm not sure whether you really intended to use both a delay of 30 minutes and args. The code can be easily adapted to your case, were it slightly different. This is much more legible.
There is also really no need to add many comments about what is being done, as everything is explicit today , timedelta ,. No need to do much calculations either, or to round things int , round.
More generally, I would advise to always have variables be of the type of object that they represent. Mainly, you are working with timestamps, so instead of calling both datetime. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Compare last modification time with specfied time Ask Question. Create new column with entries of date. Compare first and second timestamps.
Timestamps satisfying given condition. Timestamp , 1 , 5 , 12 :. Boolean value output for given condition. Timestamp , 1 , 5 , Latest timestamp. Get difference between 2 timestamps. Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics. Previous Draw Diamond shape using Turtle graphics in Python.
Clear the filecmp cache. This may be useful if a file is compared so quickly after it is modified that it is within the mtime resolution of the underlying filesystem. Construct a new directory comparison object, to compare the directories a and b. The dircmp class compares files by doing shallow comparisons as described for filecmp.
The dircmp class provides the following methods:. Print to sys. The dircmp class offers a number of interesting attributes that may be used to get various bits of information about the directory trees being compared.
0コメント