python
种花家的小白
初心不改,韶华不负
展开
-
leecode
两数之和 python class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ s = [] for i in range(len(nums)): if target - nu.原创 2021-03-24 21:26:23 · 183 阅读 · 0 评论 -
vim 的翻译插件
背景 在vim查阅代码的过程中,需要查阅部分单词,每次都复制单词或者句子到翻译里面,感觉非常不爽,也用了部分插件,发现有部分单词无法翻译,句子长短也有限制,因此自己改动了一版,基于googletrans编写 我自己的环境信息 os Mac vim 8.2 python3 + 理论上python2 也通用,需要vim编译的时候 支持python2 git链接 效果图 ...原创 2020-09-08 19:04:07 · 1348 阅读 · 0 评论 -
python常见错误(持续更新)
1.matplotlib画图报错AttributeError: ‘module’ object has no attribute ‘popall’ 解决方法如下: 原版本1.2.0升级成2.0.2 rpm -e python-matplotlib-1.2.0-15.el7.x86_64 pip install matplotlib==2.0.2 2.解码错误UnicodeDecodeE...原创 2018-05-29 17:08:33 · 399 阅读 · 0 评论 -
python 测试ftp性能
代码如下: #!/usr/bin/env python # -*- coding: utf-8 -*- import time from multiprocessing.dummy import Pool as ThreadTool from ftplib import FTP import os ftp = FTP() path = '/jfs' ftp.connect("xx.xx.xx.x...原创 2019-03-19 20:13:40 · 473 阅读 · 0 评论