python
哔哩哔哩黑马课程学习Python基础
https://www.bilibili.com/video/BV1ex411x7Em?p=1
NewDay_
这个作者很懒,什么都没留下…
展开
-
使用正则批量修改文件名
import osimport repath = "./data/test"path_list = os.listdir(path) # 获取当前文件下所有文件for path_name in path_list: dir_path = path + "/" + path_name # 拼接老路径 new_pn = re.sub("[\u4e00-\u9fa5]" ,"",path_name) # 使用正则表达式去除含有汉字 new_dp = path + "/"原创 2022-04-23 07:00:00 · 649 阅读 · 0 评论 -
python-函数与方法的区别?
原创 2022-03-05 19:55:25 · 237 阅读 · 0 评论 -
python-文件
文件的概念文件的基本操作文件/文件夹的常用操作文本文件的编码方式原创 2022-02-09 20:43:06 · 375 阅读 · 0 评论 -
python-异常和模板
异常模块原创 2022-02-10 10:00:00 · 205 阅读 · 0 评论 -
Python-面向对象(继承和多态)
单继承多继承多态类结构异常模块原创 2022-02-09 11:19:43 · 433 阅读 · 0 评论 -
Python-面向对象
面向对象基本概念类对象面向对象基本语法面向对象封装私有方法私有属性原创 2022-02-08 17:48:45 · 424 阅读 · 0 评论 -
python-函数参数和返回值
函数参数和返回值的作用函数的返回值 进阶函数的参数 进阶递归函数原创 2022-02-08 14:35:23 · 674 阅读 · 0 评论 -
python-变量
变量的引用可变与不可变类型局部变量和全局变量原创 2022-01-31 12:17:55 · 856 阅读 · 0 评论 -
python-名片管理系统
shift + F6 重命名 当修改变量名或者函数名是十分实用from learn_card_manage import card_toolsif __name__ == "__main__": while True: print("*" * 50) print("1. 新建名片".center(50)) print("2. 显示全部".center(50)) print("3. 查询名片".center(50...原创 2022-01-31 10:11:52 · 2197 阅读 · 1 评论 -
python-高级变量类型
列表元组字典字符串公共方法变量高级原创 2022-01-28 20:03:18 · 655 阅读 · 0 评论 -
python- 函数基础
函数的快速体验函数的基本使用函数的参数函调的返回值函数的嵌套使用在模块中定义函数原创 2022-01-27 11:58:10 · 270 阅读 · 0 评论 -
python-循环
程序的三大流程while 循环基本使用break 和 continuewhile 嵌套使用原创 2022-01-27 10:32:54 · 590 阅读 · 0 评论 -
python-判断(if)语句
开发中的应用场景if 语句体验if 语法进阶综合应用原创 2022-01-25 17:05:33 · 283 阅读 · 0 评论 -
程序执行原理和变量的使用
计算机三大件程序执行的原理变量的定义变量的类型python2.x 还有long类型,Python3.x 只有int类型变量的命名关键字列表['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'g原创 2022-01-24 10:25:32 · 178 阅读 · 0 评论 -
注释及运算使用
注释注释作用单行注释多行注释运算符注释作用单行注释多行注释官方PEP-08运算符原创 2022-01-24 10:24:22 · 186 阅读 · 0 评论 -
pythonIED -pycharm基础知识
Pycharm 的初始化设置设置项目编译器命名规则原创 2022-01-23 10:26:33 · 407 阅读 · 0 评论 -
Python常见错误及编译器使用
原创 2022-01-19 17:23:02 · 682 阅读 · 0 评论 -
python 简介
Python 解释性语言解释器分为两种编译器 (C语言java语言) 将其他语言翻译成机器语言的工具解释器(python)以解释方式运行(一行一行运行)编译型语言和解释型语言区别:编译型语言执行效率高于解释型语言解释型语言跨平台性好Python 设计目标python 设计哲学优雅明确简单python 特点Python 优缺点优点缺点...原创 2022-01-14 21:21:09 · 307 阅读 · 0 评论 -
vsc修改Python版本号
Exception: Python in worker has different version 3.6 than that in driver 3.8, PySpark cannot run with different minor versions. Please check environment variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON are correctly set.编译版本有问题,需要修改为3.6版本ctrl+shift+p原创 2020-12-02 19:24:46 · 342 阅读 · 0 评论 -
Python 使用 UDP 编写时间服务器
UDP server端import socketfrom datetime import datetime#使用IPV4 使用UDP协议传输数据sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)#绑定端口 "" 表示本机任意可用的IPsock.bind(("",50007))while True: data,addr = sock.recvfrom(1024)#接受数据 print('received messa.原创 2020-10-07 11:32:23 · 247 阅读 · 0 评论 -
python实现TCP步骤
TCP 服务器搭建:导入模块 import socket创建socket对象sock = socket.socket(socket_family,socet_type) 参数: socket_family socket.AF_INET IPV4 socket.AF_INET6 IPV6 socket.AF_UNIX unix 系统内部传输 socket_type socket.SOCKET_STREAM TCP协议 socket.SOCK.原创 2020-10-06 21:48:25 · 265 阅读 · 0 评论 -
Python使用TCP实现简单对话
注意:需要先启动服务器,在启动客户端TCP serverimport socketfrom os.path import commonprefixwords = { 'how are you?':"Fine thank you", 'how old are you?':'38', 'what is your name?':'Ji Ruan', "what's your name?":"Ji Ruan", 'where do you work?':'Nan.原创 2020-10-06 21:23:00 · 1072 阅读 · 0 评论