python_7

python各种符号

Keywords(关键字)
• and
• del
• from
• not
• while
• as
• elif
• global
• or
• with
• assert
• else
• if
• pass
• yield
• break
• except
• import
• print
• class
• exec
• in
• raise
• continue
• finally
• is
• return
• def
• for
• lambda
• try

• True
• False
• None
• strings
• numbers
• floats
• lists

字符串转义序列

• \\
• \‘
• \"
• \a
• \b
• \f
• \n
• \r
• \t
• \v

字符串格式化:

• %d
• %i
• %o
• %u
• %x
• %X
• %e
• %E
• %f
• %F
• %g
• %G
• %c
• %r
• %s
• %%

操作符号:

• +

• *
• **
• /
• //
• %
• <
• >
• <=
• >=
• ==
• !=
• <>
• ( )
• [ ]
• { }
• @
• ,
• :
• .
• =
• ;
• +=
• -=
• *=
• /=
• //=
• %=
• **=

时间: 2024-08-30 08:25:46

python_7的相关文章

[Python_7] Python Socket 编程

0. 说明 Python Socket 编程 1. TCP 协议 [TCP Server] 通过 netstat -ano 查看端口是否开启 # -*-coding:utf-8-*- """ TCP 协议的 Socket 编程,Server 端 Server 端绑定到指定地址,监听特定的端口,接受发来的连接请求 """ import threading import socket import time class CommThread(thre

Python 之 基础知识(五)

一.变量 1.引用 id() 函数传参 与 返回值 都是传递保存的数据的引用 2.可变和不可变类型(变量的引用地址只在赋值语句后变化) 不可变类型 内存中的数据不允许被修改 数字类型 int,bool,float,complex,long(2,x) 字符串 str 元组 tuple 可变类型 内存中的数据可以被修改 列表 list 字典 dict 字典的key只能使用不可变类型数据 哈希(hash) Python中内置一个叫hash(0)的函数 接受一个不可变型的数据作为参数 返回结果为一个整数

【爬坑】Python 3.6 在 Socket 编程时出现类型错误 TypeError: a bytes-like object is required, not &#39;str&#39;

1. 问题描述 Python 3.6 在 Socket 编程时出现错误如下 Traceback (most recent call last): File "F:/share/IdeaProjects/test/mypython/test/test10_tcpclient.py", line 17, in <module> sock.send(str) TypeError: a bytes-like object is required, not 'str' Process

Python编程快速上手(七)Unsplash批量下载器

首发于个人博客:http://rhinoc.top/post/python_7.html 程序描述 V1.0输入关键字搜索图片,模拟页面下拉获取更多图片,页面加载完成后获取图片链接并下载至指定文件夹. V2.0解决了V1.0版本存在的两个严重问题.更改为深入二级链接获取图片,从而不再需要等待一级页面加载完毕. 涉及知识点 selenium bs4 iter_content() javascript V1.0存在的问题 & V2.0的解决方法 获取图片链接需要预先对页面进行加载,下载图片时相当于进