from . import operation import calcpkg from calcpkg import * from .operation import add, mul from .operation.element import * https://dojang.io/mod/page/view.php?id=2450 파이썬 코딩 도장: 45.4 패키지에서 from import 응용하기 지금까지 calcpkg 패키지의 모듈을 가져올 때 import calcpkg.operation처럼 import 패키지.모듈 형식으로 가져왔습니다. 그러면 import calcpkg처럼 import 패키지 형식으로 패키지만 가져와서 모듈을 사용할 수 dojang.io
https://note.nkmk.me/en/python-pillow-concat-images/ Concatenate images with Python, Pillow | note.nkmk.me Pillow (PIL) can be used to concatenate (combine) multiple images vertically and horizontally. Create a background with Image.new() and paste the images with Image.paste().There are several ways to concatenate images of different sizes.This article describ note.nkmk.me
The MIT License (MIT) Copyright (c) 2018 Chart.js Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and t..
import datetime from dateutil.relativedelta import relativedelta def string_to_date(dt, format='%Y%m%d'): return datetime.datetime.strptime(dt, format) def date_to_string(date, format='%Y%m%d'): return datetime.datetime.strftime(date, format) def add_date(dt, d): date = string_to_date(dt) + datetime.timedelta(days=d) return date_to_string(date) def add_week(dt, d): date = string_to_date(dt) + da..
s=$(date +%s) # cmd ... result=$? e=$(date +%s) diff=`expr ${e} - ${s}` if [ ${diff} -lt 30 ]; then exit 1 fi exit $result https://m.blog.naver.com/PostView.nhn?blogId=darkpegasus&logNo=60196514107&proxyReferer=https:%2F%2Fwww.google.com%2F 유닉스,리눅스에서 $? 의 의미, 활용 https://coupa.ng/bLlrXA 이것이 리눅스다:with RedHat ... blog.naver.com
import datetime DAY_OF_WEEK = { "MONDAY": 0, "TUESDAY": 1, "WEDNESDAY": 2, "THURSDAY": 2, "FRIDAY": 2, "SATURDAY": 2, "SUNDAY": 6 } def string_to_date(dt, format='%Y%m%d'): return datetime.datetime.strptime(dt, format) def date_to_string(date, format='%Y%m%d'): return datetime.datetime.strftime(date, format) def day_of_week(dt): return string_to_date(dt).weekday() dt = '20210101' if day_of_week(..
https://michigusa-nlp.tistory.com/68 외부 서비스의 데이터를 python으로 slack에 통지하기 slacker 설치하기 먼저 slacker를 설치한다 $ python3 -m pip install slacker slacker의 공식 github 링크를 타고 들어가면 예시들을 볼 수 있다. slack에서 token과 webhook url 가져오기 token 취득 token 은.. michigusa-nlp.tistory.com
const chart = { type: 'bar', data: { labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4'], datasets: [{ label: 'Retweets', data: [12, 5, 40, 5] }, { label: 'Likes', data: [80, 42, 215, 30] }] } } const encodedChart = encodeURIComponent(JSON.stringify(chart)); const chartUrl = `https://quickchart.io/chart?c=${encodedChart}`; console.log(chartUrl); https://quickchart.io/documentation/send-charts-with-..
from slacker import Slacker from PIL import Image import requests import os image = "{url}" slack = Slacker(token) file = Image.open(requests.get(image, stream=True).raw) filename = DateUtils.timestamp() + '.png' file.save(filename) slack.files.upload(filename, channels='#' + channel) os.remove(filename) https://pydole.tistory.com/entry/Slack-%ED%99%9C%EC%9A%A9-python%EC%9D%84-%EC%9D%B4%EC%9A%A9..
import time print(time.time()) https://inma.tistory.com/96 [Python] datetime, timestamp 변환 timestamp 만들기 timestamp = 초 * 분 * 시 * 일 timestamp = 60 * 60 * 24 * 30 print(timestamp) # 2592000 str 으로 변환 timestamp ➠ str import time timestamp = time.time() s = str(timestamp) print(s).. inma.tistory.com
implode ( string $separator , array $array ) : string explode ( string $separator , string $string , int $limit = PHP_INT_MAX ) : array https://www.php.net/manual/en/function.implode.php PHP: implode - Manual It's not obvious from the samples, if/how associative arrays are handled. The "implode" function acts on the array "values", disregarding any keys: 'four', 'five', '3rd' => 'six' );echo imp..
isinstance(s, str) https://stackoverflow.com/questions/4843173/how-to-check-if-type-of-a-variable-is-string How to check if type of a variable is string? Is there a way to check if the type of a variable in python is a string, like: isinstance(x,int); for integer values? stackoverflow.com
pip3 install requests pip3 install Pillow from PIL import Image import requests import time file = Image.open(requests.get(image, stream=True).raw) filename = time.time() + '.png' file.save(filename) https://stackoverflow.com/questions/7391945/how-do-i-read-image-data-from-a-url-in-python How do I read image data from a URL in Python? What I'm trying to do is fairly simple when we're dealing wit..
'EEEE': Day in Week,(Sunday-Saturday) 'EEE': Day in Week, (Sun-Sat) https://stackoverflow.com/questions/33092074/whats-the-meaning-eee What's the meaning 'EEE' Looking at date filter on angular.js, EEE is used on the spot of the day of the week part, What's the meaning EEE? stackoverflow.com
https://stackoverflow.com/questions/1060279/iterating-through-a-range-of-dates-in-python Iterating through a range of dates in Python I have the following code to do this, but how can I do it better? Right now I think it's better than nested loops, but it starts to get Perl-one-linerish when you have a generator in a list compreh... stackoverflow.com
start=20200101 end=20201231 date=$start while [ $date -le $end ] do date=`date -d "$date+1 days" +%Y%m%d` done https://www.cyberciti.biz/faq/how-to-add-days-to-date-and-get-new-date-on-linux/ How to add days to date and get new date on Linux - nixCraft Explains how to add or subtract days using date command calculation on Linux, Unix, and macOS/*BSD operating system command line. www.cyberciti.biz