Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Raspberry Pi:从Python脚本启用或禁用触摸屏_Python_Raspberry Pi_Raspberry Pi4 - Fatal编程技术网

Raspberry Pi:从Python脚本启用或禁用触摸屏

Raspberry Pi:从Python脚本启用或禁用触摸屏,python,raspberry-pi,raspberry-pi4,Python,Raspberry Pi,Raspberry Pi4,我正在使用Raspberry Pi 4 B、8 gb RAM和Raspbian操作系统。我有7“触摸屏连接到PI。 在我的项目中,如果Python脚本在5分钟内没有检测到任何活动,我想让触摸屏休眠(只是为了节省一些电量)。Python脚本中有任何shell命令可以使用吗?config.txt中有“disable\u touchscreen=1”选项“这将停止Pi轮询控制器板的触摸输入。它也不会启动触摸屏输入驱动程序的固件端,这也会停止Linux端加载。显示端将完全像以前一样工作 该文件通常可以从

我正在使用Raspberry Pi 4 B、8 gb RAM和Raspbian操作系统。我有7“触摸屏连接到PI。
在我的项目中,如果Python脚本在5分钟内没有检测到任何活动,我想让触摸屏休眠(只是为了节省一些电量)。Python脚本中有任何shell命令可以使用吗?

config.txt中有“disable\u touchscreen=1”选项“这将停止Pi轮询控制器板的触摸输入。它也不会启动触摸屏输入驱动程序的固件端,这也会停止Linux端加载。显示端将完全像以前一样工作

该文件通常可以从raspbian OS以/boot/config.txt的形式访问

您可以读取config.txt并使用以下python代码进行修改

import ConfigParser

config_parser = ConfigParser.ConfigParser()
config_parser.read('config.txt')

你的问题最好放在我的问题上。