随笔分类 -  python问题汇总

在学习python中遇到的一些小问题
摘要:背景: 使用kali安装子域名收集工具(oneforall)时,安装文档的步骤执行很顺利,但在执行主程序时遇到的如下报错。 RHEL/Centos系统1、安装git和pip3sudo yum updatesudo yum install git python3-pip -y 2、克隆OneForAl 阅读全文
posted @ 2020-09-10 20:53 时光不改 阅读(6424) 评论(0) 推荐(0) 编辑
摘要:windows + python2.7 先安装VC包 https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi 再执行命令 pip install pycr 阅读全文
posted @ 2019-05-28 21:42 时光不改 阅读(3992) 评论(0) 推荐(1) 编辑
摘要:在字符串转换上,python2和python3是不同的,在查看一些python2的脚本时候,总是遇到字符串与hex之间之间的转换出现问题,记录一下解决方法。 1. 在Python2.7.x上,hex字符串和bytes之间的转换是这样的: 2. 在python 3环境上,因为string和bytes的 阅读全文
posted @ 2018-09-06 13:45 时光不改 阅读(46758) 评论(0) 推荐(2) 编辑
摘要:0x00配置phantomJS 1、 在windows平台下 此种方法是弹浏览器进行自动化测试的。 1、下载谷歌的驱动 https://chromedriver.storage.googleapis.com/index.html 2、将解压后的chromedriver.exe放到chrome浏览器的 阅读全文
posted @ 2018-04-26 23:35 时光不改 阅读(4512) 评论(0) 推荐(0) 编辑
摘要:参考链接: http://blog.csdn.net/onlyanyz/article/details/45009697 https://www.cnblogs.com/fendou-999/p/3822028.html 【解析】 UnboundLocalError: local variable 阅读全文
posted @ 2018-02-01 13:05 时光不改 阅读(294773) 评论(5) 推荐(15) 编辑
摘要:参考链接:http://blog.csdn.net/dataspark/article/details/9953225 【解析】 这个错误提示一般发生在将None赋给多个值时。 【案例】 定义了如下的函数 def test(): if value == 1: a = b = 1 return a,b 阅读全文
posted @ 2018-01-31 13:12 时光不改 阅读(159710) 评论(2) 推荐(5) 编辑
摘要:AttributeError: 'module' object has no attribute 'SSL_ST_INIT' 问题背景: 下载工具wydomain,安装依赖包以后,出现下图问题。 几经查找发现是pyopenssl库的问题。 解决方法: rm -rf /usr/lib/python2. 阅读全文
posted @ 2017-08-11 10:59 时光不改 阅读(21889) 评论(2) 推荐(4) 编辑
摘要:DEBUG: Ignoring response <403 http://movie.douban.com/top250>: HTTP status code is not handled or not allowed 怎么回事呢,被屏蔽了,我们来伪装一下,在settings.py里加上USER_A 阅读全文
posted @ 2017-06-11 11:33 时光不改 阅读(6544) 评论(0) 推荐(0) 编辑
摘要:源程序: import socket target_host = "www.baidu.com" # 127.0.0.1 target_port = 80 # 建立一个socket对象 client = socket.socket(socket.AF_INET,socket.SOCK_STREAM) 阅读全文
posted @ 2017-05-31 22:14 时光不改 阅读(28067) 评论(0) 推荐(0) 编辑