1

I am making a script that looks for changes in a file using python. It is being pushed using FTP to the server but I cannot make the script reload a file with the same name and get new data from that. i.e Mean_value=12 Server prints 12

BUT when I change that line to become 13 the following happens: Server prints 12 AGAIN. I would like it to print 13. Please help!

Ben Cartwright
  • 233
  • 1
  • 2
  • 5

2 Answers2

0

Why we cannot just reopen the file?

Alexander Mihailov
  • 1,154
  • 7
  • 15
0

As it happens I've ended up using the function 'serial', which is embedded within the USB system in order to transfer data, because it's real time.

i.e The other machine produces a 12 and then this is immediately sent to a special file, and this is accessible to other devices connected to the machine. All of this is coordinated by the baud rate.

Here is another helpful thread if that doesn't make sense: Reading serial data in realtime in Python

Hope this helps people!

Community
  • 1
  • 1
Ben Cartwright
  • 233
  • 1
  • 2
  • 5