V
V
vendettametal2017-03-11 10:04:56
Python
vendettametal, 2017-03-11 10:04:56

How to catch the moment a folder is opened?

You need to catch the moment when the user opens a certain folder, how to do it using python on a windows system
. Example:
The user went to the "C:\Documents and Settings\Admin" directory and the program should fix it somehow and take certain actions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vendettametal, 2017-03-13
@vendettametal

everything turns out to be much easier

import os.path
import time
path=("C:\******") 
a=os.path.getatime(path)
while True:
   time.sleep(1)
   print([time.ctime(x)for x in[a]])

It remains only to catch the time of the last access to the file / folder

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question