일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- pandas
- Excel
- mssql
- PER
- IOS
- PyQt
- 다이어트
- GIT
- 맛집
- Unity
- urllib
- port
- flutter
- swift
- sqlite
- ubuntu
- node.js
- PyQt5
- Linux
- tensorflow
- 라즈베리파이
- 함수
- python
- MySQL
- 유니티
- javascript
- 날짜
- 리눅스
- ASP
- MS-SQL
목록랭귀지/python (241)
아미(아름다운미소)
import osimport timefrom openpyxl import load_workbooktemp_path = "temp.xlsx"try: wb = load_workbook(temp_path) ws = wb.active # ... 작업 ...finally: # 임시 파일 닫고 삭제 (삭제 실패 시 재시도) try: wb.close() except: pass max_retries = 5 retry_delay = 0.5 # 초 for attempt in range(1, max_retries + 1): try: os.remove(temp_path) print(f"✅ 임시 파일 ..
# 1. 현재 어떤 브랜치에 있는지 확인git branch# 2. main 브랜치로 이동git checkout main# 3. 최신 상태로 업데이트 (필요 시)git pull origin main# 4. a 브랜치를 main에 머지git merge a# 5. 원격 저장소에 반영git push origin main
def write_limited_lines(file_path, new_line, max_lines=5): # 기존 파일 읽기 try: with open(file_path, "r", encoding="utf-8") as f: lines = f.readlines() except FileNotFoundError: lines = [] # 기존 내용에서 마지막 (max_lines - 1) 줄만 유지 lines = lines[-(max_lines - 1):] # 새로운 줄 추가 lines.append(new_line + "\n") # 파일 다시 쓰기 with open(file_path, "w", encoding="utf..
import timestart_time = time.time() # 시작 시간 기록for i in range(100): # 예시로 100회 반복 # 작업 수행 time.sleep(1) # 예시로 1초 대기 # 현재 시간 체크 elapsed_time = time.time() - start_time if elapsed_time > 30: # 30초 초과 시 print("30초 이상 지연되어 루프를 벗어납니다.") break
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-arm64sudo install minikube-linux-arm64 /usr/local/bin/minikubesudo chmod +x /usr/local/bin/minikubesudo apt-get updatesudo apt-get upgrade docker-cesudo systemctl status dockersudo systemctl start dockerminikube startminikube statusminikube dashboard
result = int(value) if isinstance(value, int) or (isinstance(value, str) and value.isdigit()) else 0
sqliteimport sqlite3import firebase_adminfrom firebase_admin import credentialsfrom firebase_admin import messagingclass FCMNotifier: def __init__(self, db_path, firebase_config): # Firebase Admin SDK 초기화 cred = credentials.Certificate(firebase_config) firebase_admin.initialize_app(cred) # SQLite 데이터베이스 경로 저장 self.db_path = db_path def get_device_tokens(s..
pip install firebase-admin mysql-connector-pythonimport mysql.connectorimport firebase_adminfrom firebase_admin import credentialsfrom firebase_admin import messaging# Firebase Admin SDK 초기화cred = credentials.Certificate('./path/to/your/serviceAccountKey.json')firebase_admin.initialize_app(cred)def get_device_tokens(): # MySQL 데이터베이스 연결 connection = mysql.connector.connect( host='YO..
pip install firebase-adminimport firebase_adminfrom firebase_admin import credentialsfrom firebase_admin import messaging# Firebase Admin SDK 초기화cred = credentials.Certificate('./path/to/your/serviceAccountKey.json')firebase_admin.initialize_app(cred)def send_fcm_messages(device_tokens, title, body, image_url, company_name): # 푸시 알림 메시지 생성 message = messaging.MulticastMessage( notif..
import timefrom datetime import datetime, timedeltafrom PyQt5.QtCore import QThreadclass KiwoomAPI(QThread): def __init__(self): super().__init__() self.orders = [] # 미체결 주문을 저장할 리스트 # 현재 날짜를 가져오고 시간만 추가 current_date = datetime.now().strftime("%Y%m%d") self.orders.append({'id': '0082240', 'date': f'{current_date} 090844', 'type': '+매수'}) # 예제 주문 추가..