The key to a good answer, is a good question.
What does actually connect mean?
How to wire it up?
How to fasten Nextion to the Pi?
How to start the signals?
When learning for Pi - best to ask fellow Pi users
- I have a Lemon Pi, not the same - mine is for dessert.
When learning for python - best to ask fellow python users
- I could give Pascal code - but that wont work on python.
so what other method/functions are available for your ser object?
- you have identified .write() method .. what other methods available?
read makes more sense as readln usually has a cr/lf/crlf context
- if linebreak is user changeable, then readln changed with 0xFF0xFF0xFF as linebreak maybe.
What other programming languages do you understand?
- I not several versions of PySerial, and from many places
which version of which place makes a difference
If you understand C++ than grab Arduino Nextion Library and use as template to follow
But this ole dawg does feel like learning python for an MCU I don't have on Easter.
Itead also wrote a Nextion Library for RaspPi ... but it is your goal to do in Python