user3033725
user3033725

Reputation: 89

Interfacing with Python code via file read/write?

Working with a Windows program that has it's own language with minimal interfacing options with external code, but it can read & write to files. I am looking for a method to send a set of configuration values to Python 3 code like "12,43,47,62" to query data in Pandas and return the associated results.

Someone mentioned this could possibly be done through a file interface where inputs were written to a file from the originating program and values were read back from an alternate file. I have a couple of questions regarding this concept hopefully someone could clarify for me.

  1. How well does this method handle simultaneous access where multiple calls are being made for different queries?

  2. What is the correct terminology for this type of task?

  3. Is there a way to do it so the Python code senses the change as opposed to repeatedly checking for changes?

Upvotes: 1

Views: 98

Answers (1)

ErlVolton
ErlVolton

Reputation: 6784

1) Poorly. You should put each query in its own file, responses in their own files, and encode request ID's or other information in the file names.

2) I'm not sure there is one. "File Based Communication" maybe.

3) Yes, Python watchdog.

Upvotes: 1

Related Questions