![](https://img-blog.csdnimg.cn/2021011521132923.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python
Python
淮城一只猫
只有光头才能变强
展开
-
Python序列方法
最近在学习python,总结了一下关于序列的的用法,希望帮到初学者 #主要序列类型 str list tuple #列表 list ls=[1,2,3,4] #末尾追加 ls.append(5) #添加多个,扩展 ls.extend([5,6,7]) #在某个位置插入一个值 ls.insert(2,100) ls.insert(3,'a') #移除某个对象,相同移除第一个 ...原创 2018-09-13 22:16:55 · 266 阅读 · 0 评论 -
python正则表达式
# 正则表达式 ''' re 模块 用于处理字符串的强大工具 Python的re模块拥有全部的正则表达式的功能 python中的正则表达式是一个特殊的字符序列, 检查一个字符串是否与某种模式匹配 ''' # 元字符 : # . ^ $ * + ? {} [] \ | () ''' 大多数字母和字符会匹配它们自身, 有少数特殊字符我们称为元字符...原创 2020-11-20 10:33:28 · 81 阅读 · 0 评论 -
读取excel文件并打印(python)
# -*- coding: utf-8 -*- import xdrlib ,sys import xlrd def open_excel(file= 'abs.csv'): try: data = xlrd.open_workbook(file) return data except Exception,e: print...原创 2019-06-09 23:19:18 · 6483 阅读 · 0 评论 -
UDP聊天器Demo(Python)
import socket def send_msg(udp_socket): """发送消息""" # 获取要发送的内容 dest_ip = input("请输入对方的ip:") dest_port = int(input("请输入对方的port:")) send_data = input("请输入要发送的消息:") udp_socket.se...原创 2019-06-20 19:22:38 · 141 阅读 · 0 评论