易截截图软件、单文件、免安装、纯绿色、仅160KB

Python for win

Python操作Excel方法:
(1)在sourceforge.net上有一个扩展模块叫pyXLWriter,可以方便的写Excel文件。
(2)下载win32com包装上,这个包可以调用windows的com及API函数等这类的功能。Python利用win32com操作Excel。
例子:
#!/usr/bin/env python  
# -*- coding: utf-8 -*-  
from win32com.client import Dispatch  
import win32com.client  
class easyExcel:  
      """A utility to make it easier to get at Excel.    Remembering 
      to save the data is your problem, as is    error handling. 
      Operates on one workbook at a time.""" 
      def __init__(self, filename=None):  
          self.xlApp = win32com.client.Dispatch('Excel.Application')  
          if filename:  
              self.filename = filename  
              self.xlBook = self.xlApp.Workbooks.Open(filename)  
          else:  
              self.xlBook = self.xlApp.Workbooks.Add()  
              self.filename = ''    
      
      def save(self, newfilename=None):  
          if newfilename:  
              self.filename = newfilename  
             


相关文档:

【Python】用Python来实现凑24的程序

凑24是经典的益智游戏,多玩可以使脑筋灵活一点,但是当遇到无解的时候,就会很伤脑筋,为此,写个程序来代为计算。
运行结果,去除了重复的一些表达式:
entry: 1
entry: 4
entry: 5
entry: 6
(4/(1-(5/6))) = 24
(6/((5/4)-1)) = 24
Press any key to exit...
entry: 3
entry: 3
entry: 8
entry: 8
(8/(3-(8 ......

python 基础

   Python快速入门
                        目录
1. 第一章 Python快速入门
                &nbs ......

beginning python summary chapter 3 使用字符串

0、字符串是不可变的。
1、基本字符串操作:索引、切片、复制、成员、长度、最大和最小。
2、字符串格式化:用格式化操作符百分号%实现,eg:>>> format = "Hello, %s. %s enough for ya?"
                    ......

python中os.path.dirname(__file__)的使用

     (1).当"print os.path.dirname(__file__)"所在脚本是以完整路径被运行的, 那么将输出该脚本所在的完整路径,比如:
             python d:\pythonSrc\test\test.py
         &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号