测试使用python的用途

使用Python:
1. 分析日志,尤其是服务器端日志。脚本就是短小精悍的
2. 用来生成测试数据,比如生成随机的10w个词,很麻烦;如果找一个字库,存在数表里,然后用Python取数据
3. 做数据发出的程序。比如用Python发tcp、udp
4. 写多线程。
5. 开发很少,主要是写脚本语言

 

网上找的,凌乱堆砌先

#This is the python test
import urllib;
print "Program is working............";
fileName="网址";
fileHandle=urllib.urlopen(fileName);
fileData=fileHandle.read();
fileHandle.close();
for tempLine in fileData:
print tempLine,;
print "Program is over!";



在python中如何在使用了print后不自动换行啊?

sys.stdout.write不自带自动换行,一次输出一个字符串。

Python 2:使用print后加一个逗号:print 'hello',

posted on 2014-04-21 22:04  麦兜布熊  阅读(420)  评论(0编辑  收藏  举报