This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python --version 명령 실행 | |
$pythonVersionOutput = python --version | |
# 버전 문자열에서 숫자 부분 추출 | |
$pythonVersion = $pythonVersionOutput -replace 'Python ', '' | |
# 첫 번째와 두 번째 숫자 추출 | |
$majorMinorVersion = $pythonVersion -replace '^(\d+)\.(\d+).*', '$1$2' | |
# 숫자로 변환 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipenv install pyinstaller | |
pipenv run pyinstaller --onfile --hidden-import win32timezone service.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
def main(): | |
parser = argparse.ArgumentParser( | |
prog=__file__, | |
description='What the program does', | |
epilog='Text at the bottom of help') | |
parser.add_argument('filename', nargs='?', choices=['install', 'update', 'remove']) | |
args = parser.parse_args() | |
print(args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import win32serviceutil | |
import servicemanager | |
import win32event | |
import win32service | |
import sys | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Add-EnvPath { | |
param( | |
[Parameter(Mandatory=$true)] | |
[string] $Path, | |
[ValidateSet('Machine', 'User', 'Session')] | |
[string] $Container = 'Session' | |
) | |
if ($Container -ne 'Session') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import subprocess | |
import shlex | |
import os, sys | |
from datetime import timedelta, datetime | |
parser = argparse.ArgumentParser(description='통째 영상 파일을 여러개의 비디오 파일로 분할합니다') | |
parser.add_argument('description', metavar='description', type=str, nargs=1, help='분할 영상 정보 파일을 제공하세요') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from urllib import parse | |
import json | |
import re | |
headers = { | |
'Referer': 'https://cyberbureau.police.go.kr/prevention/sub7.jsp?mid=020600', | |
} | |
fieldType = 'A' # 휴대폰은 H, A는 계좌번호 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 제목, 지은이, 출판사, 출판일, ISBN, 그림 | |
url1 = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=248169181" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=256383383" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=220179301" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=200010445" | |
# url = "https://www.aladin.co.kr/shop/UsedShop/wuseditemall.aspx?ItemId=243636605" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=165668006" | |
import requests | |
from bs4 import BeautifulSoup, Tag, NavigableString |
NewerOlder