Hi!
I'm newbie in python.
I need to do a service/daemon in python that it's always executing and it should read of a file. These file contains lines of an application that are generated by an application (like a log).
Python script should manage the lines in order and do things.
What's the best way to achive that?
In unix I use bash and FIFO file but I don't know how it's the best way with python and windows.
Thanks!
How about opening the file and reading it? Or may be I misunderstand the question?
Yes, you have reason.
But I need to manage every line once. I mean when I manage one line, these line I don't have to manage another time, so I need to discard it. Sorry for my english.
(Jan-10-2025, 10:03 PM)absolut Wrote: [ -> ]when I manage one line, these line I don't have to manage another time, so I need to discard it.
It is very difficult to understand (and it is not due to your english, besides you can use google translate to help you write in english).
Let's say you have the daemon D which processes the data and the application A that produces the data (say lines of text).
What does A do with its data? does it write it to a file that grows indefinitely?
You could perhaps show us how you do in Linux with bash and fifos. This would clarify the relation between A and D. Currently, I don't see what you are doing.
(Jan-10-2025, 09:40 PM)Gribouillis Wrote: [ -> ]How about opening the file and reading it? Or may be I misunderstand the question?
(Jan-10-2025, 10:12 PM)Gribouillis Wrote: [ -> ] (Jan-10-2025, 10:03 PM)absolut Wrote: [ -> ]when I manage one line, these line I don't have to manage another time, so I need to discard it.
It is very difficult to understand (and it is not due to your english, besides you can use google translate to help you write in english).
Let's say you have the daemon D which processes the data and the application A that produces the data (say lines of text).
What does A do with its data? does it write it to a file that grows indefinitely?
You could perhaps show us how you do in Linux with bash and fifos. This would clarify the relation between A and D. Currently, I don't see what you are doing.
Sorry I'm trying to explain better.
I have a program that generate snmp traps. The program could be configured to execute a shell script that get these snmp traps. With these script I feed a FIFO file, and then with a Daemon in Linux I read that file and I manage every line to filter the snmp data and then make a rest call to a api server if the filter matches.
I need to traslate that to windows system and I have thought to do in python language.
(Jan-10-2025, 09:40 PM)Gribouillis Wrote: [ -> ]How about opening the file and reading it? Or may be I misunderstand the question?
(Jan-10-2025, 10:12 PM)Gribouillis Wrote: [ -> ] (Jan-10-2025, 10:03 PM)absolut Wrote: [ -> ]when I manage one line, these line I don't have to manage another time, so I need to discard it.
It is very difficult to understand (and it is not due to your english, besides you can use google translate to help you write in english).
Let's say you have the daemon D which processes the data and the application A that produces the data (say lines of text).
What does A do with its data? does it write it to a file that grows indefinitely?
You could perhaps show us how you do in Linux with bash and fifos. This would clarify the relation between A and D. Currently, I don't see what you are doing.
Sorry I'm trying to explain better.
I have a program that generate snmp traps. The program could be configured to execute a shell script that get these snmp traps. With these script I feed a FIFO file, and then with a Daemon in Linux I read that file and I manage every line to filter the snmp data and then make a rest call to a api server if the filter matches.
I need to traslate that to windows system and I have thought to do in python language.
(Jan-10-2025, 10:45 PM)absolut Wrote: [ -> ]The program could be configured to execute a shell script that get these snmp traps.
How will you configure the program in Windows? Will a script get the snmp traps?
(Jan-10-2025, 10:45 PM)absolut Wrote: [ -> ]With these script I feed a FIFO file
You could perhaps send the data to a socket instead of a FIFO file.
The daemon could start a server that listens on a socket and the script or program that gets the snmp traps could connect to this server and send messages.