我现在正在与几个覆盆子Pi板。我有Pi Zero W,3B+和4B。
我将在所有这些模型上运行相同的程序。为此,我需要从Python代码中检测Raspberry板模型。像这样,
def detect_board():
'''
return string representing board type, one of the following
4B
3B+
3B
...
Zero W
Zero
'''如何获取线路板型号名称?
发布于 2021-04-22 00:24:10
感谢@Ani的评论,我像这样创建了检测函数,
def detect_model() -> str:
with open('/proc/device-tree/model') as f:
model = f.read()
return modelhttps://stackoverflow.com/questions/67199531
复制相似问题