随笔 - 366  文章 - 0  评论 - 101  阅读 - 30万

随笔分类 -  Python

1 2 下一页
python中 ‘r',’w', 'rb' ,'wb'的区别
摘要:原文链接:https://blog.csdn.net/LoveL_T/java/article/details/83274739 "r" 以读方式打开,只能读文件 , 如果文件不存在,会发生异常 Python 将会按照编码格式进行解析,read() 操作返回的是str在windows下,打开文本文件 阅读全文
posted @ 2020-06-07 12:15 寒星12345678999 阅读(3159) 评论(0) 推荐(0) 编辑
pycharm使用
摘要:简单快速解决pycharm中文乱码问题 1、点击软件上方菜单栏上“File”菜单。然后选择“File”菜单下的“Settings..”选项。接着点击弹出窗口左边的“Editor”。然后点击“Editor”下的“File Encoding”选项。接着我们可以修改图中的三个地方来解决中文乱码问题(注意: 阅读全文
posted @ 2020-02-12 16:53 寒星12345678999 阅读(149) 评论(1) 推荐(0) 编辑
Python 多进程 multiprocessing.Pool类详解
摘要:Python 多进程 multiprocessing.Pool类详解 https://blog.csdn.net/SeeTheWorld518/article/details/49639651 阅读全文
posted @ 2018-05-23 19:37 寒星12345678999 阅读(290) 评论(0) 推荐(0) 编辑
threading 多线程
摘要:# coding:utf-8 import time from threading import Thread def foo(x):#这里可以带参数def foo(x) print "foo start 启动耗时".decode('utf-8'), time.ctime() time.sleep(x) print "foo start 运行结束:".decode(... 阅读全文
posted @ 2018-04-23 20:38 寒星12345678999 阅读(151) 评论(0) 推荐(0) 编辑
chromedriver版本问题
摘要:最新的chromedriver 66.0.3359.117 的对应chromedriver版本为 2.38 http://npm.taobao.org/mirrors/chromedriver/ WebDriverException: Message: unknown error: call fun 阅读全文
posted @ 2018-04-23 16:34 寒星12345678999 阅读(2018) 评论(0) 推荐(0) 编辑
python 连接 mysql
摘要:参考 https://blog.csdn.net/piglite/article/details/78474335 yum install -y MySQL-python #打开数据库连接 conn=MySQLdb.connect(host="localhost",user="root",passw 阅读全文
posted @ 2018-04-04 00:11 寒星12345678999 阅读(175) 评论(0) 推荐(0) 编辑
pip制作离线安装包
摘要:pip命令 https://www.runoob.com/w3cnote/python-pip-install-usage.html 有的电脑无法连接外网(金融行业你懂的),上网下载包又下载不到 anaconda安装一个包(联网情况下)很简单 pip install python-docx 如何把p 阅读全文
posted @ 2017-07-04 18:35 寒星12345678999 阅读(638) 评论(0) 推荐(0) 编辑
元组
摘要:['age', 'name', 'sex'][21, 'zzx', 'male']key: agevalue: 21key: namevalue: zzxkey: sexvalue: male添加后的元组为 {'age': 21, 'online': True, 'name': 'zzx', 'se 阅读全文
posted @ 2017-06-21 15:51 寒星12345678999 阅读(89) 评论(0) 推荐(0) 编辑
fabric
摘要:local cd lcd run sudo put get reboot() prompt confirm @task @run_once from fabric.clolrs import * yellow blue red green cyan 青色 magenta 紫色 white 阅读全文
posted @ 2017-06-21 14:10 寒星12345678999 阅读(326) 评论(0) 推荐(0) 编辑
@staticmethod和@classmethod
摘要:static_foo1class_foo1hello i am foo~~~~~~~~~~hello i am foohello i am myfoo 参考 使用@staticmethod或@classmethod,就可以不需要实例化,直接类名.方法名()来调用。 阅读全文
posted @ 2017-06-21 10:06 寒星12345678999 阅读(114) 评论(0) 推荐(0) 编辑
ping
摘要:我在京东爬虫中用的到判断网络状况的代码,核心代码如下: 阅读全文
posted @ 2017-06-19 10:44 寒星12345678999 阅读(218) 评论(0) 推荐(0) 编辑
doc转docx
摘要:如何读取docx的表格内容 阅读全文
posted @ 2017-06-15 16:37 寒星12345678999 阅读(362) 评论(0) 推荐(0) 编辑
读取docx表格中的信息
摘要:结果: <type 'instance'>11['00\r', '01\r', '02\r', '\r', '10\r', '11\r', '12\r', '\r', '20\r', '21\r', '22\r', '\r', '\r', '\r', '\r', '\r', '\r', '\ 阅读全文
posted @ 2017-06-15 16:23 寒星12345678999 阅读(277) 评论(0) 推荐(0) 编辑
python 小数相加报错 invalid literal for int() with base 10
摘要:Traceback (most recent call last): File "C:/3/csv测试.py", line 26, in <module> x = int(i)ValueError: invalid literal for int() with base 10: '18.4' 这里的 阅读全文
posted @ 2017-05-25 22:47 寒星12345678999 阅读(728) 评论(0) 推荐(0) 编辑
python csv文件打开错误:_csv.Error: line contains NULL byte
摘要:正常的csv文件读取如下: 读取一个 ucs-2 le 格式(notepa++打开csv)的csv就会报错: Python CSV error: line contains NULL byte 参考了这个文章里面的内容 https://stackoverflow.com/questions/4166 阅读全文
posted @ 2017-05-25 22:24 寒星12345678999 阅读(2839) 评论(0) 推荐(0) 编辑
python csv
摘要:Python 读取csv的某行 Python 读取csv的某列 Python写了一个可以提取csv任一列的代码,欢迎使用。Github链接 阅读全文
posted @ 2017-05-25 17:37 寒星12345678999 阅读(255) 评论(0) 推荐(0) 编辑
word中替换内容
摘要:参考了一篇文章 然后做了如下修改 用python的win32com模块替换word中的文字搞定批量打印奖状 python 操作 office python操作word 阅读全文
posted @ 2017-05-25 16:04 寒星12345678999 阅读(676) 评论(0) 推荐(0) 编辑
Python 时间 time
摘要:import time print time.strftime("%Y-%m-%d") import datetime print datetime.datetime.now() shell中 date '+%Y-%m-%d' 计算今天后的第N天? import datetime now = dat 阅读全文
posted @ 2015-04-18 16:33 寒星12345678999 阅读(131) 评论(1) 推荐(0) 编辑
Python 中 str 和 repr 的区别
摘要:http://stackoverflow.com/questions/1436703/difference-between-str-and-repr-in-pythonhttp://www.oschina.net/translate/difference-between-str-and-repr-i... 阅读全文
posted @ 2015-04-02 16:01 寒星12345678999 阅读(171) 评论(0) 推荐(0) 编辑
Python 函数
摘要:@classmethodp1.get_grade = types.MethodType(fn_get_grade, p1, Person)sorted([1, 3, 9, 5, 0], lambda x,y: -cmp(x,y))闭包python中xrange和range的异同not优先级最高,or... 阅读全文
posted @ 2015-03-18 16:08 寒星12345678999 阅读(214) 评论(0) 推荐(0) 编辑

1 2 下一页
< 2025年3月 >
23 24 25 26 27 28 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 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示