Chapter 9 IOT Data Acquisition With Python and Tkinter
Chapter 9 IOT Data Acquisition With Python and Tkinter
Data acquisition: is the systematic process of collecting data from different sources to
obtain information for analysis, monitoring, or control purposes.
Data Acquisition with Python and Tkinter typically refers to the process of collecting
data from various sources using Python programming language and creating a graphical
user interface (GUI) for the acquisition using the Tkinter library.
The open() method: This function is a most commonly used method that is available in
Python, and it is used to manipulate files.
To open a file command:
>>> f = open('test.txt', 'w')
The write() method: Once the file is open in the writing mode, the write() method is
used to start writing to the file object. The write() method takes input argument only in
the format of a string.
>>>F.write(“Hello World!\n”)
The close() method: The close() method is used to close the file, and the file object can’t
be used again. The command is:
>>>W.close()
The read() method: is reads the data of a file. To use this method, open the file with any
of the reading compatible modes like: w+, r, r+, or a+:
>>>D = open('test.txt', 'r')
>>> D.read()
CSV FILE:
CSV files: are used to store the data in Python.
CSV writer: is used to write data on a CSV file and the reader to read it with simple
command.
STORING ARDUINO DATA WITH CSV FILE:
The CSV files can be used to store the sensory data from Arduino.
The objective is: to store the sensory data with CSV files and Arduino interfacing with
Python.
The ion() method: is used to initialize the interactive mode of pyplot.