python
Java and python
Python初学者
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pycharm 使用git
安装git做好git环境gitee为例pycharm 需要先安装gitee的插件插件安装搜索gitee后点击 install 安装好后重启pycharmgitee需要登陆点击+上传项目现在gitee中创建好相同的项目名在本地项目根目录下git initgit commit -m “first commit”git remote add origin 仓库地址gi...原创 2020-04-26 10:26:13 · 881 阅读 · 0 评论 -
Python转码
str与byte(b’example’)之间的转码# bytes object b = b"example" # str object s = "example" # str to bytes bytes(s, encoding = "utf8") # bytes to str str(b, encoding = "utf-8") ...原创 2019-05-24 10:34:01 · 1709 阅读 · 1 评论 -
装饰器
2层装饰器不加参数 def async(f): def wrapper(*args, **kwargs): thr = Thread(target=f, args=args, kwargs=kwargs) thr.start() return wrapper @async def a(): print("123")装饰器就...原创 2019-07-01 17:55:14 · 997 阅读 · 1 评论 -
python 简易方法
简单判断语句的缩写if len(content) > 15: title=content[0:15]else: title = content可以简化为title = content[0:15] if len(content)>15 else content```匿名函数lambdalambda 参数:函数的内容和返回的值(lambda x,y: x if x ...原创 2019-09-24 10:16:25 · 368 阅读 · 0 评论 -
Python操作数据库
Python操作redis链接数据库def redis_py(self, redis_ip, redis_port, passwd, db): pool = redis.ConnectionPool(host=redis_ip, port=redis_port, db=db, password=passwd) #, max_connections=10 r = red...原创 2019-05-07 17:46:59 · 274 阅读 · 0 评论 -
Python访问url的的方式,模拟浏览器
需要的包import requestsfrom fake_useragent import UserAgent ###随机获取uaimport urllib3import random ##随机from requests.adapters import HTTPAdapter ### 重试get——requestsdef sendGetRequest(url): ...原创 2019-05-07 16:33:20 · 9399 阅读 · 1 评论 -
Python字符串
字符串的各种方法和案例'''字符串:是以单引号或双引号括起来的任意文本,‘abc’"def"字符串不可变'''#创建字符串str1 = "sunck is a good man!"str2 = "sunck is a nice man!"#字符串运算#字符串连接,字符串不可变str3 = "sunck"str4 = "is a man"str5 = st...原创 2017-07-27 17:51:33 · 3777 阅读 · 14 评论 -
前几天整理的Python小程序
Python循环等小程序原创 2017-08-14 21:06:40 · 692 阅读 · 1 评论 -
MySQL在cmd中的操作
cmd中不区分大小写,不管输入大写还是小写,统一显示小写 SQL语句结束时一定要加;一、基本命令1、启动说明 说明:以管理员的身份运行cmd 格式:net start 服务名称 示例:net start mysql572、停止服务 说明:以管理员的身份运行cmd 格式:net stop 服务名称 示例:net stop mysql573、连接数据原创 2017-11-21 22:10:08 · 12197 阅读 · 3 评论 -
django遇到的一些问题(持续更新大概)
先放图 原因 常出现的Connection reset by peer: 原因大概有以下几点: 1.服务器的并发连接数超过了其承载量,服务器会将其中一些连接Down掉 2.客户关掉了浏览器,服务端还在给客户端发送数据 3.浏览器端按了stop 通常是因为远程主机上的对等应用程序突然停止运行,或者远程主机重新启动,或者远程主机使用“强制”关闭(在远程套接字上看到SETSOCKOPT(...转载 2018-06-27 16:35:14 · 538 阅读 · 0 评论 -
appium自己的文档(持续更新)
Python版Python + appium的链接手的一个例子#!/usr/bin/env python# -*- encoding: utf-8 -*-'''@File : kuaishoumoniqi.py @Contact : @License : @Modify Time @Author @Version @Desciptio...原创 2019-03-27 10:45:58 · 579 阅读 · 0 评论 -
python 对于时间的处理
日期转时间戳def unix_time(self, dt): ''' 日期转时间戳 :param dt: :return: ''' # 转换成时间数组 timeArray = time.strptime(dt, "%Y-%m-%d %H:%M:%S") # 转换成时间戳 timestamp = int(time.mktime(timeArray)) return timest...原创 2019-04-11 10:48:53 · 230 阅读 · 0 评论 -
Python学习期间的随笔
第一次记学习的随笔。1、数据类型:number(正数,浮点数,复数) 、 String(字符串) 、Boolean(True、False)、 None(空值) list(列表)、tuple(元组)、dict(字典)、set(集合)2、标识符:标识符是字符串,但字符串未必是标识符规则:只能由字母、数字、下划线组成 开头不能用数字 不能是Python的关原创 2017-07-26 20:02:18 · 345 阅读 · 0 评论
分享