일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- javascript
- pandas
- Excel
- PyQt
- 함수
- Unity
- 라즈베리파이
- ASP
- swift
- 유니티
- python
- 날짜
- node.js
- sqlite
- 다이어트
- 리눅스
- Linux
- tensorflow
- mssql
- IOS
- port
- PER
- urllib
- ubuntu
- MySQL
- flutter
- 맛집
- MS-SQL
- PyQt5
- GIT
목록랭귀지 (557)
아미(아름다운미소)
[PYTHON] exit 함수 : 프로그램 종료하기 exit 함수 : 프로그램 종료하기 import sys def stockExit(self): sys.exit(0) stockExit()
pyQt5 QLineEdit 패스워드설정 #패스워드설정 self.accountPassword.setEchoMode(QLineEdit.Password)
python 숫자 출력에서 천(1000) 단위마다 콤마를 출력 1. format 지정 - 파이썬 2.7 이상 value = 123456789 print "{:,}".format(value) 2. locale모듈 사용 : import locale print locale.setlocale(locale.LC_ALL, 'en_US') print locale.format("%d", 123456789, grouping=True)
How can I set default values to QDoubleSpinBoxpyqt spinbox set value from PyQt5.QtWidgets import * from PyQt5 import uic form_class = uic.loadUiType("test.ui")[0] class test(QMainWindow, form_class): def __init__(self): super().__init__() self.setupUi(self) self.price1.setValue(4000) if __name__ == "__main__": app = QApplication(sys.argv) testWindow = test() testWindow.show() app.exec_()
5 초간 휴면 상태의 스레드를 사용할 수 있습니다. import threading, time def worker(): i = 0 while (True): print 'do something ... ' + str(time.time()) time.sleep(5) i += 1 if i > 5: break t = threading.Thread(target=worker) print time.time() t.start() print time.time()
파이썬에서 round를 이용한 소수점 반올림 print(round(3.4444)) 결과 : 3.0 print(round(3.4444, 2)) 결과 : 3.44 print(round(3.5)) 결과 : 4.0 print(round(3.5555, 2)) 결과 : 3.56 print('%.2f' % 2.555) 결과 : 2.56
python sqlite -> MySQLdb 변환시 error not all arguments converted during string formatting sqllite cursor.execute("INSERT INTO image(num1, num2, filename, ext, thumbnail, image) VALUES(?, ?, ?, ?, ?, ?);" , (num1, num2, _name, _ext, _thumb, _image)) MySQLdb cursor.execute(""" INSERT INTO image (num1, num2, filename, ext, thumbnail, image) VALUES (%s, %s, %s, %s, %s, %s)""" , (num1, num2, _name, _ex..
pymysql 설치 pip install PyMySQL 예)import pymysql db = pymysql.connect(host='test.synology.me', port=3307, user='testid', passwd='testpw', db='testdb', charset='utf8') try: with db.cursor() as cursor: sql = ''' CREATE TABLE TEST ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, name VARCHAR(20) NOT NULL, model_num VARCHAR(10) NOT NULL, model_type VARCHAR(10) NOT NULL, PRIMARY KEY(id) ); ''' cursor.execut..
How to use the pandas to get the current time - pandas 설치 C:\ProgramData\Anaconda3\envs\py35>pip install install pandas=0.18.1 #-*- coding: utf-8 -*- ''' Created on 2018. 10. 30. @author: bhm ''' #판다를 사용하여 현재 시간을 얻는 방법. import pandas as pd print (pd.datetime.now()) print (pd.datetime.now().date()) print (pd.datetime.now().year) print (pd.datetime.now().month) print (pd.datetime.now().day) print ..
Python으로 SQLite에서 행의 존재를 확인하는 방법row = cursor.fetchone() if row is None: ... # row is not present else: ... # row is presentsimplerow = cursor.fetchone() if row: print "row is present" else: print "row is not present"