티스토리 뷰
"pip install openpyxl"
import openpyxl
# Extension : 'xlsx'
class cBSpread:
def __init__(self):
self.WorkBook = openpyxl.Workbook()
def CreateSpreadFile(self, fileName):
self.SpreadFile = openxl.load_workbook(fileName)
def WriteSearchedInfos(self, sheetName, searchedInfos):
#workSheet = self.WorkBook.get_sheet_by_name(sheetName)
#workSheet = self.WorkBook[sheetName]
workSheet = self.WorkBook.create_sheet(sheetName)
rowIndex = 2
colIndex = 2
count11 = 0
for searchedInfo in searchedInfos:
linkAddress1 = searchedInfo['address']
linkTitle1 = searchedInfo['title']
linkBody1 = searchedInfo['body']
count21 = 0
overlapped1 = False
for cellInfo2 in searchedInfos:
if(count21 >= count11):
break
if linkAddress1 == cellInfo2['address']:
overlapped1 = True
break
count21 += 1
if not overlapped1:
workSheet.cell(rowIndex, colIndex).value = linkAddress1
workSheet.cell(rowIndex, colIndex+1).value = linkTitle1
workSheet.cell(rowIndex, colIndex+2).value = linkBody1
rowIndex += 1
count11 += 1
def Close(self, fileName):
self.WorkBook.save(fileName)
def SaveAsSpreadFile(self, newFilename):
self.WorkBook.save(newFilename)
반응형
'SWDesk' 카테고리의 다른 글
JSON Data Transmission (0) | 2021.01.23 |
---|---|
Naver Cafe API 설명서 (0) | 2021.01.16 |
[Python] Google & Naver-news Search + Google Spreadsheet (2) | 2020.12.27 |
[Python] Managing Google Drive with Spreadsheet - testCompleted (0) | 2020.12.26 |
[Python] Managing Google Drive - testCompleted (0) | 2020.12.26 |
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 전압전류모니터링
- 혁신
- 오블완
- image
- Video
- 치매방지
- Innovations
- 심심풀이치매방지기
- 절연형
- 전류
- arduino
- DYOV
- Innovations&Hurdles
- BSC
- Hurdles
- 배프
- 심심풀이
- 아두이노
- 티스토리챌린지
- bilient
- 전압
- 치매
- ServantClock
- 둎
- 허들
- Innovation&Hurdles
- 혁신과허들
- badp
- Decorator
- 빌리언트
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함