我试图在我的RPi 3B +上制作Python代码,该代码显示时间和日期。这就是我所拥有的:
#!/usr/bin/env python
import I2C_LCD_driver
import time
mylcd = I2C_LCD_driver.lcd()
while True:
mylcd.lcd_display_string(time.strftime('%I:%M:%S %p'), 1)
mylcd.lcd_display_string(time.strftime('%a %b %d, 20%y'), 2)
我因为错误而得到了
Traceback (most recent call last):
File "my_clock.py", line 7, in <module>
mylcd = I2C_LCD_driver.lcd()
AttributeError: 'module' object has no attribute 'lcd'