'분류 전체보기'에 해당되는 글 97건
- 2025.11.03 pyside6. font
- 2023.12.21 Qslider Style Sheet
- 2022.05.13 학점 Grade 계산
- 2022.04.15 lambda
- 2022.04.15 Folder 생성/삭제, File 생성/삭제
- 2022.04.15 Open / Save File Dialog
- 2022.04.14 DeskTop path, Zip file
- 2022.04.07 cnvtol,comp,,1e-2
- 2022.04.04 Auto Complete Jupyter NoteBook
- 2021.08.30 Selenium Code
QSlider::groove:horizontal {
border: 1px solid #bbb;
background: white;
height: 10px;
border-radius: 4px;
}
QSlider::sub-page:horizontal {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #66e, stop: 1 #bbf);
background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1,
stop: 0 #bbf, stop: 1 #55f);
border: 1px solid #777;
height: 10px;
border-radius: 4px;
}
QSlider::add-page:horizontal {
background: #fff;
border: 1px solid #777;
height: 10px;
border-radius: 4px;
}
QSlider::handle:horizontal {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
stop:0 #eee, stop:1 #ccc);
border: 1px solid #777;
width: 13px;
margin-top: -2px;
margin-bottom: -2px;
border-radius: 4px;
}
QSlider::handle:horizontal:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
stop:0 #fff, stop:1 #ddd);
border: 1px solid #444;
border-radius: 4px;
}
QSlider::sub-page:horizontal:disabled {
background: #bbb;
border-color: #999;
}
QSlider::add-page:horizontal:disabled {
background: #eee;
border-color: #999;
}
QSlider::handle:horizontal:disabled {
background: #eee;
border: 1px solid #aaa;
border-radius: 4px;
}map, reduce, filter..
score = lambda x: "A등급" if x >= 80 else ("B등급" if x >= 70 else "C등급")
# ----------------------------------------------------------
add = lambda a, b: a+b
result = add(3, 5)
# ----------------------------------------------------------
arr = [[1,2,9],
[5,1,8],
[3,7,9]]
# 2열이 가장 큰 행
print(max(arr, key=lambda x: x[1])) # [3,7,9]
# 2열이 가장 큰 행의 3번째 요소
print(max(arr, key=lambda x: x[1])[2]) # 9
# ----------------------------------------------------------
# ----------------------------------------------------------
# ----------------------------------------------------------
import os
[os.remove(f) for f in glob.glob('./test/*.log')]
import os
os.rmdir(folder) # 빈 폴더가 아니면 error 발생
import shutil
shutil.rmtree(folder) # 폴더 안에 파일이 있어도 삭제
import os
path = './dir/sub_dir/tmp1'
os.makedirs(path, exist_ok=True)
os.path.exists(path or file)
os.path.isdir(dir)
os.path.isfile(file) # 파일이 존재하지 않는 경우, folder 인 경우 False
import os
os.path.expanduser('~')
os.path.join(os.path.expanduser('~'),'Desktop')
>> open and unzip file
import os
import zipfile
import tkinter as tk
from tkinter import filedialog
root = tk.Tk()
root.withdraw()
file_paths = filedialog.askopenfilenames(parent=root, title='Choose a file')
file_path = file_paths[0]
unzip_path = os.path.join(os.path.expanduser('~'),'Desktop')
with zipfile.ZipFile(file_path, 'r') as existing_zip:
existing_zip.extractall(unzip_path)
