python技术共404篇

Python初学者的一些技巧-爱站

Python初学者的一些技巧

以下是我近些年收集的一些Python实用技巧和工具,希望能对你有所帮助。 交换变量 1 2 3 4 5 6 7 x = 6 y = 5 x, y = y, x print x >>> 5 print y >>> 6 if 语句...
2站编辑的头像-爱站2站编辑3年前
0988
import reload __import__在python中的区别-爱站

import reload __import__在python中的区别

import 作用:导入/引入一个python标准模块,其中包括.py文件、带有__init__.py文件的目录(自定义模块)。 import module_name[,module1,...] from module import *|child[,child1,...] 注意:多...
2站编辑的头像-爱站2站编辑3年前
0958
Python中struct.pack()和struct.unpack()用法详解-爱站

Python中struct.pack()和struct.unpack()用法详解

python中的struct主要是用来处理C结构数据的,读入时先转换为Python的字符串类型,然后再转换为Python的结构化类型,比如元组(tuple)啥的~。一般输入的渠道来源于文件或者网络的二进制流。 1.st...
2站编辑的头像-爱站2站编辑3年前
01238
python零基础入门教程-爱站

python零基础入门教程

Python零基础入门教程 Python作为一门高级编程语言,已经在不同领域广泛应用。Python的易学易用,优雅简洁的语言特性,让它成为干净、模块化和可重用代码的首选语言。 为什么学习Python 尽管有...
2站编辑的头像-爱站2站编辑3年前
01568
python图像文字识别 - PyTesser-爱站

python图像文字识别 – PyTesser

最近在想没有一个图片文字识别的工具呢?我想到了OCR,国内比较牛逼的汉王OCR。那借助python能否实现呢?于是我找啊找查啊查有关PYthon在这方面探讨的资料,发现PyTesser 这样一个好玩的程序!...
2站编辑的头像-爱站2站编辑3年前
01138
range方法在Python2和Python3中的不同-爱站

range方法在Python2和Python3中的不同

range()方法是Python中常用的方法, 但是在Python2和Python3中使用方法不同,下面看下它们的不同使用方法。 range方法详解 range(start, stop[, step]) range是python中的其中一个内置函数 作用...
2站编辑的头像-爱站2站编辑3年前
01088
解决Python找不到ssl模块问题 No module named _ssl-爱站

解决Python找不到ssl模块问题 No module named _ssl

python安装完毕后,提示找不到ssl模块: 1 2 3 4 5 6 7 8 9 10 11 [www@pythontab.com ~]$ python Python 2.7.15 (default, Oct 23 2018, 18:08:43)  [GCC 4.4.7 20120313 (Red Ha...
2站编辑的头像-爱站2站编辑3年前
01398
python魔术方法-爱站

python魔术方法

准备工作 为了确保类是新型类,应该把 _metaclass_=type 入到你的模块的最开始。 1 2 3 4 class NewType(Object): mor_code_here class OldType: mor_code_here 在这个两个类中NewType是新类...
2站编辑的头像-爱站2站编辑3年前
01467
python 多线程之thread-爱站

python 多线程之thread

python 多线程之thread 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 #! /usr/bin/env python # -*- coding:utf-8 -*- from threading import Thread import s...
2站编辑的头像-爱站2站编辑3年前
0997
python基础 filter, lambda 函数表达式-爱站

python基础 filter, lambda 函数表达式

filter(function or None, sequence),其中sequence 可以是list ,tuple,string。这个函数的功能是过滤出sequence 中所有以元素自身作为参数调用function时返回True或bool(返回值)为True的元素并...
2站编辑的头像-爱站2站编辑3年前
01107