Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scraping apps output.
#1
Hi folks.

I've been doing a bit of Blender rendering on a couple of pis (Debian) recently, it actually works really well, if a little slow.

The Blender app churns away and generates a whole load of text output, but no timing information. I'd like to build in some trigger points like 'tile complete', 'frame complete' etc, the developers haven't got back to me about this, so I've been trying to think of other ways to do this.

From the command line I could send the output of the app anywhere, so in theory I could monitor that data file. However, I'm unsure how to do this.

It would have to work offline as well as live, so it would need to be able to process an existing file line by line, or act on a new line written to the file, obviously the time information would only be accurate in live mode. It must never act on the same line twice so I'd need to prepend each line with s special character after processing. It needs an offline/catchup mode incase of a crash or forgetting to start the scraper before blender, which I'm quite likely to do!

The trigger actions will be pretty simple 'write a line to a file' kind of thing.

I'm much better with Python than bash, but would consider either. How would you folks go about such a thing?

Many thanks.
Reply
#2
It's not clear, can you use subprocess.check_output()?
also you can watchdog to monitor the file system for file changes
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I got all excited when I stumbled on pyinotify, but I can only find examples for monitoring files in and out of directories, not lines added to individual files.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Inconsistent behaviour in output - web scraping Steve 6 2,552 Sep-20-2021, 01:54 AM
Last Post: Larz60+
  Setting up multiple flask apps in the same server leoramirez 0 2,082 May-04-2021, 08:10 PM
Last Post: leoramirez
  Running linux command line apps... dbrdh 0 1,659 Jan-30-2020, 01:14 PM
Last Post: dbrdh
  Interacting with desktop apps. SheeppOSU 1 1,898 Mar-13-2019, 06:18 AM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020