python的编程环境(第二天)1.Linux环境1)大部分linux发行版本均默认安装了python的环境,如想下载不同的版本,可以到python官网上下载。(www.python.org).软件安装方法参考linux软件安装2)在终端中输入python既可以使用python交互模式登录方式:图1linux环境下的python界面退..
分类:
编程语言 时间:
2014-08-08 16:25:16
阅读次数:
209
1 #Filename:game1.py 2 3 guess=10 4 running=True 5 while running: 6 try: 7 answer=int(raw_input('Guess what i think:')) 8 ...
分类:
编程语言 时间:
2014-08-08 15:59:16
阅读次数:
215
DenyHosts是Python语言写的一个程序,它会分析sshd的日志文件(/var/log/secure),当发现重 复的攻击时就会记录IP到/etc/hosts.deny文件,从而达到自动屏IP的功能。下面进入主题。1。安装脚本 要求安装服务器能上网,并建立 /workspace目录#####...
分类:
其他好文 时间:
2014-08-08 15:46:06
阅读次数:
268
我有的时候写程序要用到当前时间,我就想用python去取当前的时间,虽然不是很难,但是老是忘记,用一次丢一次,为了能够更好的记住,我今天特意写下python 当前时间这篇文章,如果你觉的对你有用的话,可以收藏下。取得时间相关的信息的话,要用到python time模块,python time模块里面...
分类:
编程语言 时间:
2014-08-08 15:45:26
阅读次数:
490
zen 即禅之意可以在python的命名行交互模式下以下的语句就能看到:import thisThe Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple i...
分类:
编程语言 时间:
2014-08-08 15:25:46
阅读次数:
262
Pig的数据类型能够分为两种:一种是scalar类型,包含单一的value,一种是complex类型,包含有其他的类型。对于scalar类型:int,long,float,double,chararray(取代了string),bytecharray.复杂点的类型:1、Map(我用python编写的...
分类:
其他好文 时间:
2014-08-08 15:14:36
阅读次数:
209
在用命令django‐admin.py startproject 建立一个django工程文件时,会生成一个manage.py文件,那么这个manage.py到底可以干嘛呢? manage.py是一种命令行工具,允许以多种方式与所建立的Django项目进行交互。键入python man...
分类:
编程语言 时间:
2014-08-08 15:09:56
阅读次数:
989
1 #!/usr/bin/python 2 3 read = file('thread-1554-1-1.html','r') 4 wr = file('list','w') 5 6 while 1: 7 line=read.readline() 8 if 'href' in ...
分类:
编程语言 时间:
2014-08-08 12:27:06
阅读次数:
629
#!/usr/bin/env python# -*- coding: utf-8 -*-#查找IP地址归属地#writer by keery_log#Create time:2013-10-30#Last update:2013-10-30#用法: python chk_ip.py www.goog...
分类:
编程语言 时间:
2014-08-08 12:25:55
阅读次数:
284
python3 print输出unicode字符时出现以下错误:UnicodeEncodeError: 'gbk' codec can't encode character '\u30fb解决方法:sys.stdout = io.TextIOWrapper(sys.stdout.buffer, er...
分类:
编程语言 时间:
2014-08-08 12:21:35
阅读次数:
431