E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
StringIO
Python 经验总结
1、
StringIO
模块,将输入测字符串作为流返回,可以进行迭代,示例如下
u011233383
·
2015-04-24 11:00
python
python中的
StringIO
模块
模块是用类编写的,只有一个
StringIO
类,所以它的可用方法都在类中。此类中的大部分函数都与对文件的操作方法类似。
指尖跳动的精灵
·
2015-04-16 20:00
自动安装nginx 不同版本
/usr/bin/python # conding:utf8 from optparse import OptionParser import re import pycurl import
StringIO
Art_Hero
·
2015-03-26 16:28
nginx
python
自动安装nginx 不同版本
/usr/bin/python # conding:utf8 from optparse import OptionParser import re import pycurl import
StringIO
Art_Hero
·
2015-03-26 16:28
nginx
python
Python格式化css文件的方法
importstring,sysimportre,StringIOTAB=4defformat(ss):f=open(ss,"r")data=f.read()f.close()dlen=len(data)i=0buf=
StringIO
.
StringIO
Sephiroth
·
2015-03-10 11:57
文件上传从tornado迁移到nginx upload module
tornado直接处理带文件(multipart-form)的http请求,但是文件有些文件过大,超过100M,再由tornado来处理有些不合适,stackoverflow有评论指出tornado把文件读到一个
StringIO
flyking
·
2014-12-21 12:00
【python】 读取Excel文件并绘制图表
excel文件并绘制图表代码如下: 点击(此处)折叠或打开import matplotlib.pyplotaspltimport numpyasnp import xlrdimport osfrom
StringIO
chengxuyonghu
·
2014-11-13 14:39
【python】
读取Excel文件并绘制图表
python 抓取网页
urllib2 wp = urllib2.urlopen(self.url) content = wp.read(); pycurl buf = cStringIO.
StringIO
blackproof
·
2014-11-05 20:00
python
python 抓取网页
urllib2 wp = urllib2.urlopen(self.url) content = wp.read(); pycurl buf = cStringIO.
StringIO
blackproof
·
2014-11-05 20:00
python
StringIO
, cStringIO 内存映射为文件
StringIO
的行为与file对象非常像,但它不是磁盘上文件,而是一个内存里的“文件”,我们可以将操作磁盘文件那样来操作
StringIO
。
KEYY
·
2014-10-31 04:14
StringIO
查看某个端口是否链接超时
defcurl_tyt(port): buf=cStringIO.
StringIO
() cc=pycurl.Curl() cc.setopt(cc.URL,'http://10.67.21.11
nginx2012
·
2014-10-22 18:42
python
端口超时
solrcloud 数据监控
/usr/bin/pythonimportjsonimportpycurlimportcStringIOdefwork_url(ip):buf=cStringIO.
StringIO
()c=pycurl.Curl
nginx2012
·
2014-10-10 14:55
监控
admin
return
solrcloud 数据监控
/usr/bin/pythonimportjsonimportpycurlimportcStringIOdefwork_url(ip): buf=cStringIO.
StringIO
()
nginx2012
·
2014-10-10 14:55
return
监控
admin
使用 cStringIO.
StringIO
代替临时文件
#!/usr/bin/env python # -*- coding: utf-8 -*- -#import os -#import sys - #将 lib 目录添加到系统路径,以便导入 lib 目录下的模块 -#app_root = os.path.dirname(__file__) -#sys.path.insert(0, os.path.join(app_root,
hereson
·
2014-09-13 07:00
String
python中的
StringIO
和cStringIO模块
StringIO
——像文件一样读写的模块这个模块的工作方式和python中的文件操作模块很像,该模块是进行"内存文件"的操作。
cassiePython
·
2014-08-30 17:00
python
Python脚本--Apache配置文件
/usr/bin/python from cStringIO import
StringIO
import re vhost_start = re.compile(r'') vhost_end =
brucemj
·
2014-07-18 10:35
apache
python
httpd.conf
pycrul模块 抓取页面
c.URL, 'http://news.ycombinator.com') c.perform() import pycurl import cStringIO buf = cStringIO.
StringIO
nginx2012
·
2014-07-09 17:01
import
抓取页面
StringIO
和cStringIO模块
所幸的是,在Python中,你可以使用“
StringIO
”模块来创建文件并将其保存在内存中: 1.importStringIO 2. 3.fileHandle=
StringIO
.
StringIO
(
nginx2012
·
2014-07-09 16:01
import
freedom
python 下载远程图片并生成缩略图
#coding=utf-8 from PIL import Image import os import os.path import
StringIO
import re import
cooler1217
·
2014-06-25 14:00
python
python http请求时gzip解压
encoding=utf-8 importurllib2,httplib importStringIO,gzip #解压gzip defgzdecode(data): compressedstream=
StringIO
.
StringIO
wzq9706
·
2014-05-06 13:00
python使用内存zipfile对象在内存中打包文件示例
importzipfileimportStringIOclassInMemoryZip(object):def__init__(self):#Createthein-memoryfile-likeobjectself.in_memory_zip=
StringIO
.
StringIO
·
2014-04-30 10:58
002_014 Python 回退输入文件到起点
-8 print'中国' #回退输入文件到起点 #创建一个输入文件,如Socket允许回到起点,这样就可以读取所有数据 fromcStringIOimport
StringIO
houyj1986
·
2014-03-15 19:00
深入 Python :Dive Into Python 中文版 读书笔记 第 10 章 脚本和流
原文地址抽象输入源一个重要概念是引入类文件对象(file-like)
StringIO
用于将string转换成类文件对象标准输入、输出和错误用print语句临时输出内容到某个类文件对象print>>sys.stderr
sToa
·
2014-03-02 21:00
学习笔记
深入Python
Python re 实例
# encoding=utf-8 import re try: import cStringIO as
StringIO
except: import
StringIO
as
StringIO
origin_str
dexterman
·
2014-01-18 10:00
python
re
python之
StringIO
Thismoduleimplementsafile-likeclass,
StringIO
,thatreadsandwritesastringbuffer(alsoknownasmemoryfiles)
B_H_L
·
2013-12-09 21:00
python: json,base64 的使用
json.dumps() json obj => string 3. json.load() string => json obj Base64 import base64 import
StringIO
pyzheng
·
2013-10-06 19:00
python
python: json,base64 的使用
json.dumps() json obj => string 3. json.load() string => json obj Base64 import base64 import
StringIO
pyzheng
·
2013-10-06 19:00
python
python spider code
toolbox_insight.py from sgmllib import SGMLParser import threading import time import urllib2 import
StringIO
oMingZi12345678
·
2013-07-24 09:00
飘逸的python - 简明gzip模块压缩教程
压缩数据创建gzip文件先看一个略麻烦的做法importStringIO,gzip content='Lifeisshort.Iusepython' zbuf=
StringIO
.
StringIO
()
·
2013-07-22 18:00
python
飘逸的python - 简明gzip模块压缩教程
[+]压缩数据创建gzip文件先看一个略麻烦的做法[python] viewplaincopyimport
StringIO
,gzip content = 'Life is short.I use python
pi9nc
·
2013-07-22 13:00
python
飘逸的python - 简明gzip模块压缩教程
压缩数据创建gzip文件先看一个略麻烦的做法importStringIO,gzip content='Lifeisshort.Iusepython' zbuf=
StringIO
.
StringIO
() zfile
u010180339
·
2013-07-22 07:00
GZip
StringIO
StringIO
经常被用来作为字符串的缓存,应为
StringIO
有个好处,他的有些接口和文件操作是一致的,也就是说用同样的代码,可以同时当成文件操作或者
StringIO
操作。
charlesdong1989
·
2013-07-01 15:00
StringIO
StringIO
模块的使用.它实现了一个工作在内存的文件对象(内存文件).在大多需要标准文件对象的地方都可以使用它来替换.----------------------------------------
CosmeYang
·
2013-04-16 15:00
python
StringIO
python pickler乱码问题
try: from cStringIO import StringIOexcept ImportError: from
StringIO
san_yun
·
2013-02-25 19:00
python
Python 模块学习 ----
StringIO
StringIO
-File-likeobjectsthatreadfromorwritetoastringbuffer.
StringIO
经常被用来作为字符串的缓存,应为
StringIO
有个好处,他的有些接口和文件操作是一致的
wdkirchhoff
·
2013-02-11 19:00
c++ string getline()函数
c++stringgetline()函数zoj_acm1151用到一个有用的
stringIO
操作:getline。这个函数接受两个参数:一个输入流对象和一个string对象。
asongsongsong
·
2013-01-05 12:00
python在内存中生成Zip文件!
import zipfile import
StringIO
class MemoryZipFile(object): def __init__(self):  
·
2013-01-01 23:00
python
python 查找模块里的所有函数
DictReader','DictWriter','Error','QUOTE_ALL','QUOTE_MINIMAL','QUOTE_NONE','QUOTE_NONNUMERIC','Sniffer','
StringIO
xlm289348
·
2012-12-26 16:00
服务化文档
django.conf import settings from common.coreservice2 import cacheService try: from cStringIO import
StringIO
san_yun
·
2012-10-31 11:00
服务
Python
StringIO
与cStringIO
StringIO
的行为与file对象非常像,但它不是磁盘上文件,而是一个内存里的“文件”,我们可以将操作磁盘文件那样来操作
StringIO
。
tianmo2010
·
2012-08-20 15:00
html
String
python
File
import
磁盘
python利用gzip压缩解压缩
StringIO
Whenworkingwithadatastreaminsteadofafile,usetheGzipFileclassdirectlytocompressoruncompressit.Thisisusefulwhenthedataisbeingtransmittedoverasocketorfromreadanexisting(alreadyopen)filehandle.AStringIObu
jhonguy
·
2012-08-15 02:00
Stream
socket
python
File
Integer
import
python spider code
toolbox_insight.py from sgmllib import SGMLParser import threading import time import urllib2 import
StringIO
wangran51
·
2012-07-20 15:00
Python: 利用
StringIO
缓存,避免生成文件
importStringIOraw_data=
StringIO
.
StringIO
()在以前用f的地方用
StringIO
比如:writer=csv.writer(raw_data)或者直接用1.raw_data.getvalue
·
2012-07-19 04:00
python
python 打开sqlite3内存数据库,操作完毕将数据保存到文件数据库
#encoding=utf-8 # 甄码农代码 2012 03 06 # 打开sqlite3内存数据库,执行操作,将内存数据库保存到文件 import sqlite3 import
StringIO
dqifa
·
2012-06-07 15:00
python
sqlite
内存数据库
python抓取一个页面
Created on 2012-5-17 @author: chenhuiting ''' import sys import urllib2 import gzip import
StringIO
have_life
·
2012-05-17 11:00
html
python
页面抓取
python 中提供字符串相关功能的模块总结
1.unicodedata模块2.difflib模块用于展示文件和字符串之间的差别3.io模块的io.
StringIO
类,用于读写字符串,就像对文件读写一样;4.textwrap模块提供了用于包裹与填充字符串的函数和方法
索隆
·
2012-04-23 15:00
Python里pycurl使用记录
/usr/bin/envpython#-*-coding:utf-8-*-importStringIOimportpycurl html=
StringIO
·
2012-02-28 17:00
python
SSH BruteForcer Source code
#http://www.darkc0de.com#d3hydr8[at]gmail[dot]comimportsys,time,
StringIO
,commands,re#Setthesuccessfullo
BruceChen
·
2012-02-26 21:00
exception
ssh
user
command
File
login
python 可变参数 *args, **kwds
*kwds的方法,如: mechanize的模块_form.py中有如下代码: def ParseString(text, base_uri, *args, **kwds): fh =
StringIO
mj4d
·
2012-02-03 22:00
python
mechanize
python中pickle得使用
import pickle pickle.dump(obj, file, 0) 从文件中读出对象 obj = pickle.load(f) ps:从网络读过来得对象流可以通过
StringIO
zydest
·
2011-12-01 05:00
python
pickle
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他