Python2023. 5. 19. 15:11

python schedule 을 이용한 프로그램 시작과 종료

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)

 

내가 안짰음...

chatgpt 가 짜줌 ^^

 

Posted by 비니미니파파
Python2023. 4. 4. 14:47

 

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)

 

python 시간 포맷을 알아보려면 아래 사이트를 방문 하자!

https://docs.python.org/3/library/datetime.html

 

datetime — Basic date and time types

Source code: Lib/datetime.py The datetime module supplies classes for manipulating dates and times. While date and time arithmetic is supported, the focus of the implementation is on efficient attr...

docs.python.org

 

Posted by 비니미니파파

https://nodejs.org/download/release/v10.24.1/

 

Index of /download/release/v10.24.1/

 

nodejs.org

 

NodeJs 버전은 10.x.x 사용

node-gyp 은 6.1.0 사용

~]# npm install -g node-gyp@6.1.0

끝!!!

 

Posted by 비니미니파파
Raspberry Pi2022. 12. 20. 10:09

 table header 를 html thead tr 사용 하지 않고 정의 하기

<table id="example" class="display" style="width:100%">
    <thead>
    </thead>
</table>

 

<script>

$('#example').DataTable( {
  columns: [
	{"data":"mdate","title":"날짜"},
	{"data":"username","title":"이름"},
	{"data":"tel","title":"연락처"}
  ]
} );

</script>
 

 

Posted by 비니미니파파