Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on a code's design
#1
Hi,

I'm designing a button-less clock using a Raspberry with a SD card and I'm doing it this way:

With a php code I create a data.json settings file where I store alarm time, brightness level, etc.

then with a python code, I load the libraries, read the settings and display time. If the time matches, sounds an alarm.

Because the code displays the time every seconds, the settings file (data.json) is constantly read.

My question is, if reading the data file so many times per minutes and thus per year, is it affecting the SD card's life or is there a better way of doing it?

TIA
Reply
#2
I see at least 2 other ways to do it
  1. Write the json file on a ramdisk instead of the SD card, or
  2. Start a server with the python script, such as a web server or a xmlrpc server or a simple socketserver, then attempt to connect this server from the php script and send the data instead of writing them in a json file.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with User Interface design code ai_masti 0 1,899 Nov-19-2020, 05:58 PM
Last Post: ai_masti
  API design question: use methods or properties? johsmi96 1 1,648 Oct-12-2020, 02:24 PM
Last Post: buran
  generate UML design from python code Phaze90 2 2,427 Apr-13-2020, 11:36 AM
Last Post: Phaze90
  Design question will __call__ rudihammad 1 1,866 Aug-11-2019, 11:58 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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