일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- sqlite
- flutter
- mssql
- PER
- 리눅스
- GIT
- 맛집
- ASP
- 함수
- python
- 유니티
- MS-SQL
- javascript
- 다이어트
- MySQL
- PyQt5
- port
- urllib
- IOS
- pandas
- 라즈베리파이
- PyQt
- swift
- 날짜
- Linux
- Unity
- tensorflow
- node.js
- Excel
- ubuntu
목록랭귀지/python (238)
아미(아름다운미소)
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': '+매수'}) # 예제 주문 추가..
from flask import Flask, jsonify, requestfrom dbhelper import DBHelperapp = Flask(__name__)# DBHelper 인스턴스 생성db = DBHelper(host='localhost', user='your_username', password='your_password', database='your_database')db.connect()# CRUD 엔드포인트@app.route('/users', methods=['GET', 'POST'])def users(): if request.method == 'GET': # 사용자 목록 조회 users = db.read('users').fetchall() re..
import mysql.connectorfrom mysql.connector import Errorclass DBHelper: def __init__(self, host, user, password, database): self.host = host self.user = user self.password = password self.database = database self.connection = None self.cursor = None def connect(self): try: self.connection = mysql.connector.connect( h..