I'm going to assume you are using a 1602 LCD with one of these I2C backpacks:
https://www.aliexpress.com/item/LCD1602 ... 14933.html
Git clone or download the repo:
https://github.com/dhylands/python_lcd
Open the lcd folder.
You simply need to copy 2 of these files to your board.
You can use rshell, ampy, etc.
Depending on how many free IO pins you have, and whether you are using the PCF8574 I2C backpack or connecting directly to the LCD determines which files to copy across.
For
ESP8266 -> PCF8574 backpack -> LCD, copy these files to your board:
* esp8266_i2c_lcd.py
* lcd_api.py
For
ESP8266 -> LCD, copy these files to your board:
* nodemcu_gpio_lcd.py
* lcd_api.py
The ESP32 can use the same examples.
There is an ESP32 example, esp32_gpio_lcd.py, which is basically identical to nodemcu_gpio_lcd.py.
When connecting via GPIO, you have the option to use 4 or 8 data lines.
If you want to use an MCP23008 IO expander, have a look at pyb_i2c_adafruit_lcd.py
Once you have uploaded the drivers to your board, have a look at the associated _test.py files, which show you how to interact with them.