Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live monitoring of directory for real-time fitting #2

Open
Paradoxdruid opened this issue Jun 23, 2021 · 2 comments
Open

Live monitoring of directory for real-time fitting #2

Paradoxdruid opened this issue Jun 23, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Paradoxdruid
Copy link
Owner

Add functionality - new GUI or enhancement - to monitor a folder and process data as it is saved in real-time.

@Paradoxdruid Paradoxdruid added the enhancement New feature or request label Jun 23, 2021
@Paradoxdruid Paradoxdruid self-assigned this Jun 23, 2021
@Paradoxdruid
Copy link
Owner Author

This is a simple but perhaps useful approach:

import os, time
path_to_watch = "."
before = dict ([(f, None) for f in os.listdir (path_to_watch)])
while 1:
  time.sleep (10)
  after = dict ([(f, None) for f in os.listdir (path_to_watch)])
  added = [f for f in after if not f in before]
  removed = [f for f in before if not f in after]
  if added: print "Added: ", ", ".join (added)
  if removed: print "Removed: ", ", ".join (removed)
  before = after

from http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html

@Paradoxdruid
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant