码迷,mamicode.com
首页 > 编程语言 > 详细

Python 模块之间调用

时间:2015-03-19 17:56:58      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:

__VERSION__ = 1.0
import xlrd as rd;
import xlwt as wt;
import os;


class ExcelOperation():
    def readExcel(self):        
        excelDir=os.getcwd()+"\\"+"2222.xls";
        book=rd.open_workbook(excelDir);
    
        sheet1=book.sheets()[0];
    
        for i in range(sheet1.nrows):
            for j in range(sheet1.ncols):
                print(sheet1.cell(i,j).value)
         
    def writeExcel(self):
        ""
        ""

if __name__=="__main__":
    obj=ExcelOperation()
    obj.readExcel()
            
import unittest
import OpExcel as EO;


class Test(unittest.TestCase):


    def testName(self):
        testEO=EO.ExcelOperation();
        testEO.readExcel()

if __name__ == "__main__":
    #import sys;sys.argv = [‘‘, ‘Test.testName‘]
    unittest.main()

 

Python 模块之间调用

标签:

原文地址:http://www.cnblogs.com/Bbrook/p/4351093.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!