Pycharm处理 E501 line too long 警告

众所周知,python代码有一个格式检查工具 flake8 , 对代码规范化确实很有帮助,但有时候也很烦,比如行长度限制。
在这里插入图片描述

Makefile:6:recipe for target 'flake' failed

解决办法有三种:

  1. 修改代码,行字符长度控制在 79 个字符之内
    原代码:
    在这里插入图片描述
    修改后:
    在这里插入图片描述

  2. 修改配置,放宽限制条件
    我的python项目是使用 pyscaffold 创建,环境使用venv,修改如下配置即可:
    注意:图片中书写有误,等号左右不能有空格,不然不生效,切记;
    在这里插入图片描述

  3. 修改命令行参数
    归根到底说原理,以上第二种配置方式其实就是在 flake8 命令执行的时候添加了相关的参数,知道这一点,我们的解决方案就更灵活了。
    3.1 修改 Makefile 文件
    首先你项目要有 Makefile 文件,如果你不知道Makefile 文件是干啥的,那请跳过直接看 3.2,因为我的项目是使用Makefile配置文件进行 flake8 检查,代码测试以及打包,所以在此提及。
    在这里插入图片描述
    3.2 命令行执行
    首先,确保你的系统安装了 flake8,然后,执行以下命令则会将一行的字符个数限制提高到 128 个字符

	flake8 [项目目录] --max-line-length=128
  • 6
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
基于GPRS的智能药品分拣装置设计 摘要 近年来,人们生活水平不断提高,逐渐出现了许多因为没有合理膳食,也缺乏适量运 动引发的慢性常见病。随着看病人群数量的急剧增多,由于医院药房工作人员要根据病 人递给的药单逐个地找药和取药,效率低,所以经常在医院看到这样的情形:人们在取 药的窗口排很长的队伍,等待取药。 本毕业设计针对上述问题,为提高医院药房工作人员的效率,设计实现了一种智能药 品分拣装置。本设计实现的装置由触摸屏、GPRS通信模块、西门子S7- 200PLC、药品架等组成。该智能药品分拣装置可接收医院医疗信息服务器的处方信息, 快速指导工作人员找到处方药品,发放给病人,大大缩短了药房工作人员的取药时间, 节省了患者等待的时间,并且能够避免在取药过程中人为造成的取错药问题。 关键词:西门子S7-200PLC 触摸屏 GPRS通信 药品分拣 Design of an intelligent drugs sorting device based on GPRS Abstract In recent years, people's living conditions continue to improve. Gradually people who take too high calorie food and lack exercise are suffering from some common chronic diseases. The number of medical people is increasing sharply. The hospital pharmacy staffs need take medicine and get medicine to a patient one by one according to the prescriptions. So the efficiency is low. Often in the hospital the lines of people who are waiting for getting medicine are long. In order to solving the above problems, this design produced an intelligent sorting device. The device is composed of a touch screen, a GPRS DTU module, a SIEMENS S7-200PLC, medicine cabinets. The intelligent sorting device can receive the information of prescription from the hospital server, and quickly guide the staff to find the drugs. Then the drugs can be provided to the patient. The time of taking medicine can be shorten by using this device. And the waiting time of the patient can be saved too. Particularly during the process of taking the medicine, the problem of taking the wrong medicine can be avoided. Key words:Siemens S7-200 PLC Touch screen GPRS communication Sorting drugs 目 录 摘要 I Abstract II 目 录 III 1 绪论 1 1.1 课题研究背景及意义 1 1.2 本课题所在研究领域的国内外现状与发展趋势 1 1.2.1 国外研究和应用现状 1 1.2.2 国内研究和应用现状 1 1.3 本课题研究的内容 2 2 装置的总体设计 3 2.1基于GPRS无线通信方式的医院药房取药过程的分析 3 2.2 基于GPRS的智能药品分拣装置的总体设计 3 3 装置的具体设计 4 3.1 通信单元的设计实现 4 3.1.1 GPRS DTU模块的选用、安装及配置 4 3.1.2 模拟医疗信息服务器的建立 7 3.1.3 服务器和装置之间双向通信的协议约定 9 3.1.4 通信单元的通信测试 11 3.2 显示单元的设计实现 12 3.3 控制单元的设计实现 14 3.3.1 PLC的选择 14 3.3.2 PLC控制程序的编写 14 3

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值