自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 资源 (2)
  • 收藏
  • 关注

原创 vue读取本地json文件

方法一(我用的):import test_mcc_json from '@/assets/data/test_mcc.json'方法二:import axios from 'axios'Vue.prototype.$http=axiosthis.$http.get('../../static/data.json').then((response) => { c...

2019-07-25 20:38:12 2802

原创 pymongo使用find出现游标

问题如下:使用Collection.find({id: id}),出现下面的<pymongo.cursor.Cursor object at 0x000002AC60B3E9B0>解决:使用find_one()

2019-03-13 08:52:44 6054 4

原创 python 写入数据到文件中

1.写入numpy的向量numpy.save("result", feature_vec_sum)2.读取numpy的向量np.load('result.npy')3.writelines(str)只能写入str因此再次从文件中读取时,也为str若写入【1,2,3,4,5】数组则writelines(str(array))再次读出时,eval(str)即可转为数组...

2019-03-12 20:06:10 1635

原创 python 训练word2vec时:C extension not loaded for Word2Vec, training will be slow.

训练word2vec时:UserWarning: C extension not loaded for Word2Vec, training will be slow. Install a C compiler and reinstall gensim for fast training.解决:anaconda里面输入:conda install mingw libpyth...

2019-03-10 20:14:23 9008 14

原创 pymongo 出现pymongo.errors.AutoReconnect: connection closed

pymongo.errors.AutoReconnect: connection closed原因是:for col in sinaDetailCollection.find({}): ....更改为:curors = sinaDetailCollection.find({},no_cursor_timeout=True)for col in curors : ...

2019-03-07 20:05:56 4296

原创 linux 常用命令

1.创建文件夹:mkdir test2.删除:rm 文件名3.查看进程:ps -ef4.杀死进程: kill -9 进程号5.查看文件以及文件大小:ls -lh6.复制文件 :cp 原始文件路径/文件名 要复制的文件路径/文件名7.读出 BLM.txt 文件一共有多少行:wc -l BLM.txt8.将txt按行拆分多个: split -l 2482 /root/test/word...

2019-03-07 18:55:23 231

原创 部署scrapy项目到腾讯云服务器,并操作爬虫

第一步:在腾讯云购买服务器 第二步:在本机下载scrapyd-client:对于windows系统,建议不要用pip install scrapyd-client去安装scrapyd-client,会出现,scrapyd-deploy不是内部或外部命令,因为scrapyd-deploy不能被windows执行。应当直接去github上下载并解压安装包后,进入解压后的目录下,执行py...

2019-01-29 11:49:16 1163

原创 服务器端安装mongodb数据库,本地远程连接服务器端mongodb,系统为centos

第一部分:服务器端安装mongodb参考:参考文章下载安装包wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.9.tgz解压tar -zxvf mongodb-linux-x86_64-3.2.9.tgz解压后文件夹重命名mv mongodb-linux-x86_64-3.2.9 mong...

2019-01-28 21:42:33 2351

原创 python3关闭SSL验证

 因为网址使用了https,因此关闭验证verify=Falserequest = requests.get(item_url, headers=headers, verify=False) 

2019-01-15 19:10:52 4615

原创 scrapy 使用pipeline写入数据到mongoDB

简述Item在Spider中被收集后,会传入Item pipeline中进行处理。Item pipeline当中的类负责接收Item,并对item执行一些操作(清理,丢弃,验证,去重,存数据库等)。在setting.py文件中进行配置# mongodb数据库相关连接MONGO_DB_URI = '127.0.0.1'MONGO_DB_PORT = 27017MONGO_DB_N...

2019-01-12 17:09:56 1790 3

原创 mongodb可视化工具mongobooster

下载地址:https://nosqlbooster.com/downloads下载完后点击exe文件直接安装出现以下界面点击file> connect,出现以下界面,选择from url此前需要用命令行方式启动mongodb,点击上图的test connection,进行连接测试,若测试通过,出现下面的界面 此时数据库测试连接成功 ,点击ok进行连接...

2019-01-11 16:25:51 6118

原创 python当中的mongoDB的使用

准备工作:1.python安装好pymongopip install pymongo2.本机安装mongoDB详情见参考文章:https://blog.csdn.net/u014705021/article/details/51777123https://www.cnblogs.com/melonjiang/p/6536876.html连接mongoDBfrom...

2019-01-10 17:55:43 199

原创 DeprecationWarning: save is deprecated. Use insert_one or replace_one instead

python的mongoDB使用时,不建议使用save,应当使用insert_one或者replace_one 

2019-01-10 16:33:31 5556

转载 python import导入的路径问题

转载自https://blog.csdn.net/u010138758/article/details/80152151

2019-01-09 19:45:12 8609

原创 python的import和from...import的路径问题

若图1当中的sinaSpider想要导入图二上层目录的cookies文件,则图1图2from .cookies import cookies

2019-01-09 17:49:29 4740

原创 python3.7的except Exception, e: ^ SyntaxError: invalid syntax

python2:try:..............except Exception, e:.........python3:try:..............except Exception as e:......... 

2019-01-09 17:32:57 13693 1

原创 python2与python3的区别

1.urlparse,urljoin库python2import urlparseurl = urlparse.urlparse('https://mp.csdn.net/postlist')url2 = urlparse.urljoin('https://www.cnblogs.com/itlqs/p/6055365.html', 'aaaaaaa')python3fro...

2019-01-09 17:03:04 134

转载 centos 解决python3.7 安装时No module named _ssl

转载自:https://www.jianshu.com/p/3ec24f563b81

2018-12-30 17:14:56 2679

原创 关于虚拟机下_ssl不存在

Centos环境中:除了安装openssl,还要安装动态库和相关头文件openssl-develyum -y install opensslyum -y install openssl-develubuntu环境中:sudo apt-get install libssl-devsudo apt-get install openssl...

2018-12-30 17:13:27 1521

转载 ubuntu关于W: GPG error: http://archive.canonical.com intrepid Release错误

 方法1:Try to run the following comamnds from terminal$ sudo -iapt-get cleancd /var/lib/aptmv lists lists.oldmkdir -p lists/partialapt-get cleanapt-get update方法2:Try to run the following ...

2018-12-30 16:50:24 1455

原创 unbuntu pkg_resources.DistributionNotFound: The 'pip==1.5.4' ,排查发现pip不在环境变量中

最开始遇到的问题是:使用pip安装scrapy报错:unbuntu pkg_resources.DistributionNotFound: The 'pip==1.5.4' distribution was not found and is required by the application因此参考博客https://blog.csdn.net/allyli0022/article...

2018-12-29 18:53:58 2402

原创 ubuntu安装完twisted之后,安装scrapy仍然报错:ModuleNotFoundError: No module named 'twisted.persisted'

报错如图:原因:twisted版本比较低,而python的版本比较高1.查看pip版本2.查看twisted版本pythonimport twistedtwisted.version 因此更新twisted版本 wget https://pypi.python.org/packages/source/T/Twisted/Twisted-17.1.0....

2018-12-29 18:50:00 1139

原创 pip install scrapy时报错:Could not find a version that satisfies the requirement Twisted>=13.1.0

pip install scrapy时报错:Could not find a version that satisfies the requirement Twisted>=13.1.0 (from Scrapy) (from versions: ) No matching distribution found for Twisted>=13.1.0 (from Scrapy) ...

2018-12-29 18:00:35 900

原创 ubuntu安装scrapy报错

pip install scrapy时报错:Could not find a version that satisfies the requirement Twisted>=13.1.0 (from Scrapy) (from versions: ) No matching distribution found for Twisted>=13.1.0 (from Scrapy) ...

2018-12-29 17:58:05 290

原创 ubuntu安装python3.7,并更新python默认指向为python3.7

ubuntu默认带着的python版本不是最新版,因此需要手动安装最新版。查看python的指向。ls -l /usr/bin | grep python可以看到,此时python指向的是python3.4。第一部分:安装python3.71.直接使用apt-get安装python3.7失败:apt-get install python3.72.改为手动安装...

2018-12-24 17:57:44 208102 66

原创 ubuntu安装python3.7过程中make test命令出错ModuleNotFoundError: No module named ‘_ctypes’

问题1:ModuleNotFoundError: No module named ‘_ctypes’ 解决:1.sudo apt-get update关于sudo apt-get update 出现fetch  ppa错误,请移步我的另一篇博客https://blog.csdn.net/u014775723/article/details/852240262.sudo ap...

2018-12-24 17:55:02 23654 14

原创 sudo apt-get upgrade相关错误解决

错误1:dpkg: error while cleaning up:subprocess installed post-installation script returned error exit status 1解决:cd /var/lib/dpkgsudo mv info info.baksudo mkdir info sudo apt-get upgrade...

2018-12-23 17:10:33 9047 1

原创 关于sudo apt-get update 出现fetch ppa错误

关于sudo apt-get update 出现以下错误W: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.7/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found解决:将对应的ppa删除即可步骤1:切换到对应的ppa目录   cd /e...

2018-12-23 16:54:08 6220

原创 Forbidden by robots.txt错误

运行scrapy spider时,出现Forbidden by robots.txt错误原因:在settings.py文件里有个ROBOTSTXT_OBEY参数,默认为True。False为拒绝遵守robot协议,True为遵守robot协议解决:将settings.py文件里的ROBOTSTXT_OBEY参数,设为False.。即ROBOTSTXT_OBEY = False...

2018-12-19 18:47:47 831

原创 使用datetime.datetime.now()报错

使用datetime.datetime.now()报错原因是:from datetime import datetime此时命名空间是已经是datetime.datetime因此应该直接使用datetime.now()或者import datetime

2018-12-19 18:36:38 5927 1

原创 python 使用Join时出现错误

使用Join时出现错误TypeError: sequence item 1: expected str instance, int found原因是:应该将list转为string即使用str()result3 = join(str(['',1,3,4]))

2018-12-19 17:44:12 2987

原创 virtualBox ubuntu 重置登陆密码

1.开机时,按Esc键,进入root模式,选择第二个Advanced options for Ubuntu,按enter​​​​​​​2.选择有recovery mode的选项,按e进入3.进入后找到ro recovery nomodeset,更改为rw single init=/bin/bash,按ctrl进入单用户模式4.命令行输入passwd修改密码...

2018-12-19 12:57:44 3596

原创 唯品会2016年产品实习生(互联网产品)面经

唯品会产品实习生的笔试很简单,我相信只要是认真做完的都会收到面试通知。四月9日晚上大概六点突然收到了唯品会面试通知,地点是上海,时间是周一下午三点,当时感觉很欣喜,第一次收到了面试通知。同时又有点发愁,毕竟从武汉到上海需要时间还有金钱(不报销),匆匆给家里打了电话就去订票和订住宿了,周一到了上海,很紧张,我提前去了酒店,大概12点就到了。但是因为工作人员的疏忽,大的签到表上并没有我的名字,小的签到

2016-04-15 09:14:37 562

MFC Windows程序设计(第2版)修订版源代码

MFC Windows程序设计(第2版)修订版源代码,很全的电子书哦,希望大家能有帮助

2016-01-05

MFC实现的五子棋

7个五子棋,包括可以选择人机对战还是人人对战.zip

2016-01-04

空空如也

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

TA关注的人

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