摘要:
在django中需要URL 的地方,对于不同层级,Django 提供不同的工具用于URL 反查: 1、在模板中:使用url 模板标签。 2、在Python 代码中:使用 django.core.urlresolvers.reverse() 函数。 3、在更高层的与处理Django 模型实例相关的代码 阅读全文
摘要:
第一种 (function checkCookie(){ console.log("hello world!!!!!"); }()) 第二种 (function checkCookie(){ console.log("hello world!!!!!"); })() 第三种 !function ch 阅读全文
摘要:
Linux设置自动登录如下: 在CentOS下,我们每次需要用root账号手动登陆,但是再做automation时,我们需要免登录,直接进入OS。 很简单,按图中所示修改配置文件保存并重启,则会免登录. gedit /etc/gdm/custom.conf 在[daemon]下添加: Automat 阅读全文
摘要:
PEP 8 -- Python 代码样式指南 https://www.python.org/dev/peps/pep-0008/ 阅读全文
摘要:
下载安装mingw-get-setup.exe: https://osdn.net/projects/mingw/releases/ 或直接下载:https://osdn.net/projects/mingw/downloads/68260/mingw-get-setup.exe/ https:// 阅读全文
安装redhat报错:Entering emergency mode exit the shell to continue. Type “journalctl” to view system logs
摘要:
安装redhat系统 如果过程中出现: Entering emergency mode exit the shell to continue. Type “journalctl” to view system logs. 解决方法: 这时在提示符下输入以下两行命令 cd devls在出现的几列字符中 阅读全文
摘要:
#!-*-coding:utf8-*- import serial # 导入模块 ####Get avilable port import serial.tools.list_ports port_list = list(serial.tools.list_ports.comports()) pri 阅读全文
摘要:
描述符定义 描述符是一种类,我们把实现了__get__()、__set__()和__delete__()中的其中任意一种方法的类称之为描述符。 描述符的作用是用来代理一个类的属性,需要注意的是描述符不能定义在被使用类的构造函数中,只能定义为类的属性,它只属于类的,不属于实例,我们可以通过查看实例和类 阅读全文
摘要:
import openpyxl import warnings warnings.filterwarnings("ignore") """ https://openpyxl.readthedocs.io/en/stable/styles.html """ #Python Excel Create a 阅读全文
摘要:
最近在用pyautogui写自动化的脚本时,用pyautogui.locateonscreen("shell.PNG")函数来判断机器成功进入EFIshell会一直返回None。 且shell.PNG在当前屏幕置顶可见,但就是抓不到。 解决方法:安装opencv,并在locateOnScreen添加 阅读全文