본문 바로가기

전체 글

(40)
Python File Searching Python File Searching import os import subprocess def search(dirname): try: filenames = os.listdir(dirname) for filename in filenames: full_filename = os.path.join(dirname, filename) if os.path.isdir(full_filename): search(full_filename) else: ext = os.path.splitext(full_filename)[-1] if ext == '.tar': # print(full_filename) ## full name file_pathss = full_filename.rstrip('.tar')..
Python Excel Control Python Excel Control from openpyxl import Workbook from openpyxl.styles.borders import Border, Side from openpyxl.styles import PatternFill, Color, Font, Alignment ## 테두리 지정 box = Border(left=Side(border_style="thin", color='FF000000'), right=Side(border_style="thin", color='FF000000'), top=Side(border_style="thin", color='FF000000'), bottom=Side(border_style="thin", colo..
Python 개발환경 Setting Python 개발환경 Setting 비주얼 스튜디오 코드(Visual Studio Code) 설치 아래의 경로에서 비주얼 스튜디오 코드(Visual Studio Code)를 다운로드 받아 설치 한다. https://code.visualstudio.com/ 파이썬(Python) 설치 아래의 경로에서 파이썬(3.X)를 설치 한다. https://www.python.org/downloads/ VSCode Extension Setting 비주얼 스튜디오 코드(Visual Studio Code)에 파이썬(Python) 확장(Extension) 설치 1) 메뉴 > 보기 > 확장 2) 검색어에 python 입력 3) Python(Don Jayamanne) 설치
Python PyAutoGUI Control Python PyAutoGUI Control Python PyAutoGUI install pip install pyautogui https://pypi.org/project/PyAutoGUI/ Python PyAutoGUI Keyboard and Mousee Control import pyautogui # Move the mouse to the x, y coordinates 100, 150. pyautogui.moveTo(100, 150) # Click the mouse at its current location. pyautogui.click() # Double click the mouse at the pyautogui.doubleClick() # Click the mouse at the x, y coo..
Python PowerShell Python PowerShell import subprocess subprocess.call(["C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "ls"])
Real-time Python Jenkins Build Status Check Real-time Python Jenkins Build Status Check import jenkins ## Jenkins Info Jserver = jenkins.Jenkins('url', username='admin', password='admin') while True: lastBuild = Jserver.get_job_info('JobName')['lastBuild']['number'] url = Jserver.get_build_info('JobName', lastBuild) if url['building'] == True: print('Jenkins Job Building ..
Python GitLab Module Install Python GitLab Module Install pip install python-gitlab GitLab Login import gitlab gl = gitlab.Gitlab('URL', private_token='Token') Get the list of users users = gl.users.list() users = gl.users.list(search='foo') # by ID user = gl.users.get(user_id) # by username user = gl.users.list(username='root')[0] Create a user user = gl.users.create({'email': 't..
GoogleCloudPlatform VM Instance Create GCP VM Instance Create Introduction Cloud Service에는 AWS( Amazon Web Services ) , GCP ( Google Cloud Platform ) Azure ( Microsoft Azure ), 등이 있습니다. 그 중 개인이 사용하기 무리없는( 요금폭탄 X ) CGP의 항상 무료버전 VM Instance 생성을 기록하고자 합니다. 항상 무료버전의 사양은 vCPU1개, 614MB 메모리, 20G 입니다. 사양이 좋지 않으므로 간단히 Web(ex: NginX)을 올리거나 Vim으로 급하게 생각난 사항을 코딩 혹은 기록하는 용도로 봐야될듯 합니다. Gnome 설치 결과 사용불가 수준 GCP 접속 ( https://cloud.google.com/ ) Compu..