文章列表
 
您正在查看 "Python" 分类下的文章

2009-08-26 16:28
最早原型参考骨头的BLOG上的文章,然后东抄西抄,自己整理一下,做备份用
现已改成完全能在linux, win下正常运行的脚本, 还未在FreeBSD下测试

#!/usr/bin/env python

#coding:utf-8

import tarfile
import smtplib
import datetime
import time
import os
import sys
import shutil
from email.Header import Header
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart

source = ('iptables/','pf_server_scripts/')


t
 
2009-08-05 13:10

【分享】一套Python入门视频

来源 http://bbs.linuxeden.com/thread-187252-1-1.html

分享】一套Python入门视频
刚学Python,网上的资源相对较少,尤其是视频。刚刚在网上找一套视频,拷过来大家一起看看。前面几讲讲的挺细的。
第1讲   Python概述:http:
 
2009-04-16 17:12
#!/usr/bin/python
point=("/","/usr","/var","/tmp")
dev=("/dev/hda1","/dev/hda2","/dev/hda3","/dev/hda6")

for inx in xrange(len(point)):
print "%s = %s" % (point[inx], dev[inx] )

#for (v, k) in (point, dev):
#print "%s = %s" % (v, k )

mydict = {}
for i in xrange(len(point)):
mydict[point[i]] = dev[i]

for d in mydict:
print
 
2009-02-26 21:58
[axlrose@mygentoo strtest] $ cat strtest.py
#!/usr/bin/env python
import os

src_str = raw_input("input string:")

def str_loop(mystr):
    if not isinstance(mystr, str):
        print "not string"
        return ""
    str_len = len(mystr)
    for i in xrange(str_len):
   
 
2008-11-06 12:36
#!/usr/bin/env python
#--coding:utf-8
import sys
import os
import socket

def Proc(SrcFileName, DestFileName):
    srcFileHandle = open(SrcFileName, 'rb')
    destFileHanel = open(DestFileName, 'wb')
    srcFileHandle.seek(0, 0)
    print "now seek = %s" % (srcFileHandle.tell(), )
    srcFileHandle.seek(0, 2)
    fileLen = srcFileHandle.tell(
 
2008-09-10 17:51
因为想在windows下使用cscope + ctags + gvim , 之前在linux下
find ./ -name "*.c" -o -name "*.cpp"   就是把所有程序文件存到一个指定文件中然后 用cscope索引

找到

Python写的列举指定目录下所有子目录的工具

http://blog.csdn.net/Jupin/archive/2005/01/15/254871.aspx
但他是只列出有程序
 
2008-08-29 12:45
检查下globals()或者locals()是否有该变量的定义
>>> a = 1
>>> locals().has_key('a')
True
>>> locals().has_key('small')
False

或者就用try...except,异常是NameError

还有个vars(),跟上面的locals类似

也就是有的书上说的LGV

http://bbs.chinaunix.net/thread-1256967-1-1.html 转自CU上的,很实用
 
2008-08-20 12:08
 
2008-08-17 11:59
 
2008-08-15 14:57

Python for S60

Please follow our opensource site for the latest Python for S60 -details.

Python for S60 brings the power and productivity ofthe Python programming language to the S60 platform. The tools enable rapid application development and prototyping, and the ability to create stand-alone S60 applications written in Python.

The device installation package includes the Python interpreter

 
   
 
 
文章存档
 
     
 
最新文章评论
  

很发好
 

靠,回复了还没有
 

[表情]
 

看不懂
 

试试看!
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu