美文网首页Python四期爬虫作业
【Python爬虫】-第四期课后练习12

【Python爬虫】-第四期课后练习12

作者: 困困harper | 来源:发表于2017-08-28 20:58 被阅读5次
import os

class storeCsv():

def __init__(self, filename,filepath,message):
self.filename = filename
self.filepath = filepath
self.message = message

def isExist(self):
file = self.filepath+self.filename
if os.path.exists(file):
self.message = 'OK, the '+file+' file exists.'
else:
self.message = 'Sorry, I cannot find the '+file+' file.'
print(self.message)

test = storeCsv('in.txt',r'D:\\workspace\\kun1\\timerBatch\\File\\','')
test.isExist()

相关文章

网友评论

    本文标题:【Python爬虫】-第四期课后练习12

    本文链接:https://www.haomeiwen.com/subject/wfugdxtx.html