![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Blood_Seeker
Accustomed,one day.
展开
-
pandas无法打开.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file; not supported
原因是最近xlrd更新后只支持.xls文件。所以pandas.read_excel(‘xxx.xlsx’)会报错。可以安装旧版xlrd,在终端中运行:pip3 uninstall xlrdpip3 install xlrd==1.2.0也可以用openpyxl代替xlrd打开.xlsx文件:pip3 install openpyxl接着可在python脚本中执行:df=pandas.read_excel(‘data.xlsx’,engine=‘openpyxl’)...原创 2021-02-21 10:07:37 · 639 阅读 · 0 评论 -
python 实现简单的端口扫描器
# -- coding: utf-8 -- # port scan script 2.0 import optparse from socket import * from threading import *screenLock = Semaphore(value=1)def connScan(tgtHost, tgtPort):try: connSkt = socket(AF_INE原创 2017-04-27 10:03:55 · 3229 阅读 · 0 评论 -
二叉树的创建及遍历(Python版)
二叉树的创建及遍历(Python版)#!/usr/bin/python3#-*- coding: utf-8 -*-#Function: simulate the binary tree in python#__author__: Tresser#class BTNode(object): def __init__(self, key=None, lchild=None, rchi原创 2018-01-15 21:02:25 · 8193 阅读 · 5 评论 -
链表的创建与基本操作(Python版)
链表的创建与基本操作(Python版)#/usr/bin/python#-*- coding: utf-8 -*-#Function: simulate the link-list in python#__author__: Tresser#class LNode(object): #结点初始化函数, p 即模拟所存放的下一个结点的地址 #为了方便传参, 设置原创 2018-01-07 00:48:34 · 25490 阅读 · 6 评论 -
解决安装python包网络不可达问题
解决安装python包网络不可达问题如图, 升级pip3报网络不可达的错,安装某些python包也失败,原始的pip3是从国外拿资源,速度慢,资源少,这里我们可以用华科大的镜像,操作如下: sudo pip3 install cython -i https://pypi.mirrors.ustc.edu.cn/simple/ ...原创 2018-04-12 11:49:49 · 6039 阅读 · 0 评论 -
.pyc文件的编译与反编译
编译 python 为 .pyc 文件: import py_compile pycompile.compile(filename)反编译 .pyc 文件: pip install uncompyle2 命令行执行:uncompyle6 filename.pyc原创 2018-08-15 13:50:04 · 1553 阅读 · 0 评论 -
python byte,hex,ascii转换
python 2.7.x: a = "String" a_byte = a.decode('hex') a = a.encode('hex')python 3.5以上: a = "String" a_byte = bytes.fromhex(a) a = a_byte.hex()原创 2018-08-16 08:58:13 · 12125 阅读 · 0 评论