import schedule
import time
current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
# print(current_time)
def start_program():
print(current_time)
print("프로그램이 시작되었습니다.")
def end_program():
print(current_time)
print("프로그램이 종료되었습니다.")
# 시작 시간과 종료 시간 설정
start_time = "15:05" # 시작시간
end_time = "15:06" # 종료시간
# 스케줄링된 작업 추가
schedule.every().day.at(start_time).do(start_program) # 시작 시간에 프로그램 시작 작업 추가
schedule.every().day.at(end_time).do(end_program) # 종료 시간에 프로그램 종료 작업 추가
# 무한루프를 돌며 스케줄링된 작업 실행
while True:
schedule.run_pending()
time.sleep(1)
import time
from datetime import datetime
while True:
# 현재 시간 출력 YYYY-MM-DD HH:MI:SS
s = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(s)
# 1초간 sleep
time.sleep(1)
nodejs 나 electron 개발 시 visual studio code 가 좀 더 편한거 같다.
터미널을 연다.
터미널에서
~> npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help init` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (pjtest)
version: (1.0.0)
description: Test Project
entry point: (index.js)
test command: start
git repository:
keywords:
author:
license: (ISC) MIT
About to write to C:\dev\vstudio\workspace\pjTest\package.json:
{
"name": "pjtest",
"version": "1.0.0",
"description": "Test Project",
"main": "index.js",
"scripts": {
"test": "start"
},
"author": "",
"license": "MIT"
}
Is this OK? (yes) y
package.json 이 생성되었으면 반은 성공
일렉트론을 설치해 보자
~> npm install --save-dev electron
added 87 packages, and audited 88 packages in 21s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities