상황
급식 외주에서 발송되는 주간식단표가 있다. 이 식단표는 회사 식당 관련 애플리케이션에 업로드 해야 회사 직원들이 애플리케이션에서 금주의 식단표를 확인할 수 있다.
미션
매주 수신하는 식단표에 있는 "주간식단표" 표를 JPG 파일로 만들어서 네트워크 폴더에 올리는 Python 스크립트를 작성하자.
사용할 도구
- Outlook rules
- Python
ChatGPT 명령어
Please write script lab code to open attached excel file and copy cell from A1 to F29 and then create a jpg file with copied cell then save in the network path in "\\kryanser03\Shared-Data\컴퓨터드라이버\석식조사\MealPlan"
ChatGPT 결과물
import openpyxl
from openpyxl.drawing.image import Image
# Load the attached excel file
workbook = openpyxl.load_workbook("attached_file.xlsx")
# Select the first worksheet
worksheet = workbook.worksheets[0]
# Copy the cells from A1 to F29
image = Image(worksheet.cell_range("A1:F29").value)
# Save the image as a jpg
image.save("copied_cells.jpg")
# Save the workbook in the network path
workbook.save("\\\\kryanser03\\Shared-Data\\컴퓨터드라이버\\석식조사\\MealPlan\\attached_file.xlsx")
Note that this script assumes that the openpyxl library is installed on your system. If you don't have it installed, you can install it by running pip install openpyxl.
고찰
마이크로소프트 Script Lap에 사용할 코드 작성을 요구했으나 Python 스크립트가 작성 되었다. Script Lap에서는 주로 JavaScript가 사용되는 것을 감안하면 날 실망시키는 결과물이다. 또한 그림파일을 네트워크 경로에 저장해 달라는 요구를 엑셀파일을 네트워크 경로로 저장해 달라는 요구로 인식했다.
세부적이고 구체적인 요구조건을 명시하지 않는 한 만족스러운 결과를 얻지 못할 것으로 보인다.
ChatGPT에서 스크립트를 잘 뽑아주면 바로 자동화에 적용시키려고 했으나 아래의 제약 사항이 있어서 업무 자동화에 도입하지 못했다.
1. Outlook 규칙에서 "스크립트 실행" 옵션을 본인이 근무하는 회사 정책에서 막아 놓았다.
2. 당장 하지 않아도 업무에 지장이 없는 일이라 우선 순위에서 밀렸다.
'ICT' 카테고리의 다른 글
[PowerShell] Saving Activie Directory Query Output to CSV (0) | 2023.03.20 |
---|---|
[Powershell]2. Syntax (0) | 2023.02.07 |
RAID(Reduntant Array of Independent Disk) (0) | 2023.01.30 |
[PowerShell]1. What is PowerShell (0) | 2023.01.13 |
PowerShell Learning Pathway (0) | 2023.01.13 |
댓글