![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
u014413032
这个作者很懒,什么都没留下…
展开
-
python3 伪装浏览器爬取网页内容的简单示例
#! /usr/bin/env python # -*- coding=utf-8 -*- # @Author 512pic import urllib.request url = "http://www.512pic.com" headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, ...转载 2020-01-10 11:48:33 · 303 阅读 · 0 评论 -
Python遍历文件、遍历文件夹的示例
代码摘自:http://www.512pic.com/181/2151-0.html #!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import shutil dir = "/mnt/Packages" class Packages: def __init__(self,srcdir,desdir): ...转载 2020-01-07 21:05:13 · 179 阅读 · 0 评论 -
解决python中文乱码问题
# @param python中文乱码问题大总结 # @author 512笔记|512pic.com #!/usr/bin/env python #coding=utf-8 s="中文" if isinstance(s, unicode): #s=u"中文" print s.encode('gb2312') else: #s="中文"...转载 2020-01-07 20:55:23 · 266 阅读 · 0 评论 -
python遍历文件夹下所有文件
关于Python遍历文件脚本摘自:http://www.512pic.com/181/2151-0.html转载 2018-10-08 21:57:51 · 1118 阅读 · 0 评论 -
python里面的全局变量小例子
python里面的全局变量小例子:http://www.512pic.com/181/1766-0.html转载 2018-10-26 14:25:19 · 555 阅读 · 0 评论