# importing all the functions# from http.server module# * means allfromhttp.serverimport*# creating a class for handling# basic Get and Post RequestsclassGFG(BaseHTTPRequestHandler):# We will create a function# for Get Request using the command belowdefdo_GET(self):# Successful Response --...
예를 들어 resize() 함수를 사용하여 이미지를 압축해 보겠습니다. 아래 코드를 참조하십시오. from PIL import Image input_img = Image.open("test.jpg") print("input image size:", input_img.size) output_img = input_img.resize((...
from nta import Button ButtonText init(self, title, code=None, **kwargs) title: 버튼 값. code : 버튼에 숨겨진 code 값. 자세한 정보 buttonText Button.ButtonText('보여지는 타이틀', '숨겨진 코드값') ButtonLink init(self, title, url,...
(default: INFO)--channelfile [CHANNELFILE]channel file path (default: Channel.json)--xmlfile [XMLFILE] write output to file if specified--xmlsock [XMLSOCK] send output to unix socket if specified--parallel run in parallel--dbfile [DBFILE] export/import data to/from dbOnline help: <...
import time def return_abc(): alphabets = [] for ch in "ABC": time.sleep(1) alphabets.append(ch) return alphabets위 함수를 호출한 결과를 for 루프로 돌려보면 3초가 후가 흐른 후에 A, B, C가 한 번에 출력이 되는 것을 ...
from datetime import datetime datetime.strptime("2018-01-31", "%Y-%m-%d") 결과는 datetime.datetime(2018, 1, 31, 0, 0) 문자열 형식 코드의 지시문은 참조 용으로 여기에 나열되어 있습니다. 지령의미예 %a 로케일의...
다음 코드는 많은 수를 처리 할 때 두 연산자의 차이점을 보여줍니다. x=50000000000a1=int(x*(x+3)/2)a2=x*(x+3)//2print("Using single division operator: ",a1)print("Using floor division operator: ",a2) ...
frompathlibimportPath 이것은 데이터 파일의 위치를 저장하는 전역 변수DATA_DIR입니다.경로는 상위 디렉토리 데이터 내의 파일을 나타냅니다. DATA_DIR=Path(__file__).parent/"data" ...
from itertools import permutations lst = ["".join(p) for p in permutations("day")] print(lst) 출력: ['day', 'dya', 'ady', 'ayd', 'yda', 'yad'] join()함수를 사용하여 튜플 요소를 결합하고 목록을 반복하여 각 튜플에 사...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from apyori import apriori 위에 주어진 코드에서 작업에 필요한 모든 라이브러리를 가져왔습니다. 이제 pandas를 사용하여 데이터 세트를 읽어야...