博文

目前显示的是标签为“python”的博文

制作Android7.1关机充电动画

    在Android7.1系统上面,关机充电动画已不再是5.1里的几张图片,如下:     在Android5.1的system/core/healthd/images目录下,有如下文件:     battery_0.png     battery_1.png     battery_2.png     battery_3.png     battery_4.png     battery_5.png     battery_charge.png     battery_fail.png     capacity_text_bottom.png     capacity_text_left.png     capacity_text_right.png     capacity_text_top.png     而在Android7.1的同一目录下,则只有如下文件:     battery_fail.png     battery_scale.png     其中,battery_scale.png为相应的动画文件,我们查找了一翻,发现在bootable/recovery目录下有interlace-frames.py文件,该文件用于将几张PNG图片合成一张PNG图片,我们使用如下命令将上面的battery_scale.png解包:     python interlace-frames.py -d battery_scale.png -o battery.png     会生成battery00.png、……、battery05.png共6个文件,而这6个文件刚好对应system/core/healthd/healthd_mode_charger.cpp文件里的default_animation_frames定义: static ...

HomeAssistant无法运行解决方法

    按照https://www.hachina.io/docs/355.html安装Home Assistant后,执行hass --open-ui命令,提示如下:        Home Assistant requires at least Python 3.5.3       查了资料,参考了https://community.home-assistant.io/t/python-3-5-3-on-synology/46372/2,执行如下命令重新安装指定版本的Home Assistant:     python3 -m pip install homeassistant==0.64.3

Ubuntu apt-get安装virtualenv失败处理一例

在Ubuntu里面安装virtualenv时出现如下提示: guochongxin@xinu:~/xinu/python$ sudo apt-get install python-virtualenv Reading package lists... Done Building dependency tree           Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies:   libc-dev-bin : Depends: libc6 (< 2.16) but 2.17-0ubuntu5 is to be installed   libc6 : Breaks: libc6:i386 (!= 2.17-0ubuntu5) but 2.15-0ubuntu10.4 is to be installed   libc6:i386 : Breaks: libc6 (!= 2.15-0ubuntu10.4) but 2.17-0ubuntu5 is to be installed   libc6-dev : Depends: libc6 (= 2.15-0ubuntu10.4) but 2.17-0ubuntu5 is to be installed   libc6-i386 : Depends: libc6 (= 2.15-0ubuntu10.4) but 2.17-0ubuntu5 is to be installed   libnih1 : PreDepends: libc6 (< 2.16) but 2.17-0ubuntu5 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution...