自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

danhuazhou的博客

个人学习笔记

  • 博客(30)
  • 资源 (2)
  • 收藏
  • 关注

原创 python进制转换

十进制转二进制、八进制、十六进制:num = 5num_bin = bin(num) # 转二进制num_oct = oct(num) # 转八进制num_hex = hex(num) # 转十六进制print(num_bin, num_oct, num_hex)# 结果为 0b101 0o5 0x5转十进制:int() 函数用于将一个字符串或数字转换为...

2018-07-26 17:14:46 860 1

原创 jinja2.exceptions.UndefinedError: 'app.models.Comment object' has no attribute 'movie'

{% for v in page_data.items %}<div class="comment-text"> <span class="username"> {{ v.user.name }} ...

2018-07-26 17:09:38 2313 1

原创 汤姆猫

汤姆猫说明:点击汤姆猫的不同部位会做不同的动作发出不同的声音素材:https://download.csdn.net/download/lollipop_sun/10282500代码:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewp

2018-03-12 20:34:15 789

原创 雪花飘落动画效果

雪花飘落动画效果雪花素材:效果图:代码:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"&

2018-03-12 20:25:35 1763

原创 Linux命令系统管理

Linux命令系统管理1.查看当前日历:calcal命令用于查看当前日历,-y显示整年日历:2.显示或设置时间:date(1)设置时间格式(需要管理员权限):date [MMDDhhmm[[CC]YY][.ss]] +formatCC为年前两位yy为年的后两位,前两位的mm为月,后两位的mm为分钟,dd为天,hh为小时,ss为秒。如: date 010203042016.55。(2)显示时间格式(...

2018-03-10 16:27:28 268

原创 linux命令用户权限管理

linux命令用户权限管理1.查看当前用户:whoamiwhoami该命令用户查看当前系统当前账号的用户名。可通过cat /etc/passwd查看系统用户信息。2.查看登录用户:whowho命令用于查看当前所有登录系统的用户信息。常用选项:-m或am I:只显示运行who命令的用户名、登录终端和登录时间-q或--count:只显示用户的登录账号和登录用户的数量-u或--heading:显示列标题...

2018-03-10 16:26:57 290

原创 scrapy爬虫问题items与pipelines

scrapy爬虫问题items与pipelines问题描述:在爬虫py文件里写了两次yield item(两个item内容不同),在pipelines分别写了两个与item对应的pipeline,item传输的数据只能进入优先级高的pipeline。解决:因为item传输的数据会传给每个pipeline(setting已设置),所以会出现以上问题。假设Aitem、Bitem、Apipeline、B...

2018-03-09 19:11:12 1893 1

原创 FileNotFoundError: [Errno 2] No such file or directory

FileNotFoundError: [Errno 2] No such file or directory代码如下filehand = open('d:/file/ads.txt','w')filehand.write('abcd')filehand.close()原因:d盘下午file文件夹,w模式在没有ads.txt时会自动创建该文件,但不会创建文件夹。...

2018-03-09 19:10:23 31588

原创 IndentationError: expected an indented block

IndentationError: expected an indented blockimport randomrandom_list = []for i in range(0,100):rand = random.randint(0,30)random_list.append(rand)print(random_list)for ran in random_list:#出错位置def get_...

2018-03-09 19:09:33 611

原创 _tkinter.TclError: bad geometry specifier "200×100"

_tkinter.TclError: bad geometry specifier "200×100"import tkinter as tkwindow = tk.Tk()window.title('my window')#这里应该写200×100,应该写成200x100,x是小写字母x不是乘号window.geometry('200×100')...

2018-03-09 19:07:52 7268 1

原创 ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot exe

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement在安装mysql,修改root密码时候出错原因:权限没有刷新解决:flush privileges;...

2018-03-09 19:07:06 1461

原创 安装scrapy出现time out问题

安装scrapy出现time out问题解决方法:如果安装过程中提示time out,那么采用下面的命令来安装pip install -i https://pypi.douban.com/simple scrapy

2018-03-09 19:05:55 2298 7

原创 安装scrapy时出现error: Microsoft Visual C++ 14.0 is required问题

安装scrapy时出现error: Microsoft Visual C++ 14.0 is required问题解决方法:1.下载twisted对应whl文件下载网址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twistedcp后面是python版本,win后面代表32位或者64位2.下载Microsoft Visual C++ 14.0.下载安装后...

2018-03-09 19:04:42 901

原创 scrapy同时爬取51job和智联招聘

scrapy同时运行2个及以上爬虫方法每个爬虫创建对应的运行文件,然后运行每个文件。每个爬虫的数据模型要相同。run1.py# -*- coding:utf-8 -*-from scrapy import cmdline#ccmdline.execute(['scrapy, crawl, 爬虫1'])cmdline.execute('scrapy crawl 爬虫1'.split(' '))run...

2018-03-08 20:21:44 1589

原创 Two Sum

Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the ...

2018-03-08 20:09:04 319

原创 Reverse Integer

Reverse IntegerGiven a 32-bit signed integer, reverse digits of an integer.Note:Assume we are dealing with an environment which could only hold integers within the 32-bit signed integer range. For the...

2018-03-08 20:07:08 137

原创 Palindrome Number

Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.mycodeclass Solution:    def isPalindrome(self, x):        """        :type x: int        :rtype: bool       ...

2018-03-08 20:06:45 107

原创 Roman to Integer

Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.mycodeclass Solution:    def romanToInt(self, s):        """        :type s: s...

2018-03-08 20:06:03 114

原创 Linux命令文件磁盘

Linux命令文件磁盘Linux命令格式command: 命令名; [-options]:选项,可用来对命令进行控制,[]代表可选 parameter1 …:传给命令的参数,可以是零个一个或多个command [-options] [parameter1] …--helplinux命令自带的帮助信息,如:ls --help 显示ls可进行的命令选项man(manual)man是linux提供的一个...

2018-03-08 20:02:13 174

原创 仿站小工具使用

仿站小工具使用有时候我们把整个网页代码复制到自己创建的html文件中,但在打开时却和原网页有出入,这是由于少了一些样式。用仿站小工具下载的话就能避免这种问题,它会把网页样式图片等下载下来。直接在网上搜索仿站小工具,然后下载,具体使用如下。1.输入要下载的网址,点击添加2.添加后,点击转到下一步3.选择保存地址,然后开始下载4.在保存路径下可找到该文件夹现在再打开html文件,就会与原网页相同了...

2018-02-26 20:57:25 10403 3

原创 Bootstrap框架的简单使用

Bootstrap框架的简单使用Bootstrap中文网:http://www.bootcss.com/1.打开Bootstrap网址下载Bootstrap打开:https://v3.bootcss.com/getting-started/#download根据需要下载不同的Bootstrap,这里我们下载第一个。2.解压Bootstrap文件压缩包,放入自己的项目里项目目录如下:3.在HTML文...

2018-02-26 20:55:30 672

原创 HTML常用标签

HTML常用标签<html><head><meta charset="utf-8"><title>网页标题</title><!--引入样式--><link rel="stylesheet" href=""><!--引入脚本-->

2018-02-26 20:51:30 3856

转载 Android KeyCode列表

KEYCODE列表电话键 KEYCODE_CALL拨号键5KEYCODE_ENDCALL挂机键6KEYCODE_HOME按键Home3KEYCODE_MENU菜单键82KEYCODE_BACK返回键4

2018-02-02 15:43:28 168

原创 mysql5.7.21免安装版本的配置

本文主要记录自己安装mysql的过程,用于记录学习。安装配置大致如下:把下载的mysql压缩包解压到想要安装软件的目录(下载地址https://dev.mysql.com/downloads/),我的放在了D盘D:\mysql-5.7.21-winx64。顺便把bin目录写入系统的环境变量path中。my.ini文件 记得设置自己的安装目录和数据目录[client]#端口p

2018-01-31 19:39:10 1514

原创 Python字典及相关函数

字典字典 : 以key:value键值模式存储数据的,可以存储任何类型的数据,字典中存储的数据是无序的声明字典,字典中key是不可变的 ,一般推荐使用字符串/数字作为字典中的key,key必须是唯一的1.字典声明dict_1 = {'name':'zhangsan','age':22,'phone':'110'}2.字典的添加和修改添加数据#如果字典中有这个ke

2018-01-29 21:07:45 691

原创 Python元组及相关函数

元组1.tuple元组的用法元组也是python内置一个容器类,元组中的数据一旦确定就不可更改,不能进行添加、删除、修改的操作可以认为元组就是一个不可变的列表(list)2.声明元组# 如果元组中只有一个元素,在python2中必须在元素后添加一个逗号例如:tup=(1,),python3中可以不用加tuple_1 = (3.14, 'hello', 'world',2

2018-01-29 20:46:45 1825

原创 Python列表及相关函数

列表list列表 容器类  列表中存数的数据是有顺序的,可以存放数字,字符串,对象。。。。。1.声明一个列表 ,列表中如果有多个元素,每个元素之间用,逗号隔开list_1 = [1, 'hello', True, 3.1415926, 'world']print list_12.列表生产式[数据 条件]#产生100个1number1 = [random.ra

2018-01-29 18:58:10 932

原创 django制作简易博客

python3.5 django2.0.11.创建MyBlog项目用Pycharm创建,打开菜单中的file>new project创建项目后的目录如下:也可以用命令行来创建项目Windows+r输入cmd,打开cmd后cd desktop到桌面这样项目也就创建到桌面了,这样方便查看。2.主要代码创建所需文件,目录如下:其中templates

2018-01-29 16:36:32 623

原创 Pycharm创建自己的第一个django项目

我用的环境是python3.5 django2.0.1 1.打开pycharm,选择菜单栏file>New Project 2.项目目录结构如下 3.写代码 views.pyfrom django.shortcuts import renderfrom django.shortcuts import HttpResponse# Create your views here

2018-01-26 10:01:16 3897

原创 Django安装

首先提前安装好python安装方法1.用pip来安装django命令行中输入 pip install django2.直接下载django安装包手动安装下载地址https://www.djangoproject.com/download/下载后解压后用命令行执行解压出的stepup.py,然后配置环境变量。3.Pycharm下载如果装了Pycharm或许可以在P

2018-01-25 18:09:44 244

汤姆猫素材图片和声音111

制作汤姆猫的素材,包括动作图片和相应的动作声音,同时包括汤姆猫的html代码。

2018-03-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除