일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- pywinauto
- 네이버 로그인 하기
- 왕초보 파이썬 실행
- 네이버 로그인 캡챠해결
- pycdc.exe
- pycdas.exe
- 커머스API
- vscode venv 설치
- 파이썬 네이버 로그인
- 네이버매물크롤링
- Element is not clickable at point
- 네이버 로그인 영수증 해결
- 파이썬 가상환경 설치
- 네이버커머스API
- 파이썬 환경설정
- pywinauto 윈도우
- Uipath 기초
- Selenium 셀렉터잡기
- Python
- venv 설치
- 네이버부동산크롤링
- selenium
- 파이썬네이버부동산
- 가상환경설치
- 파이썬 가상환경 설치방법
- UiPath
- pywinauto 윈도우제어
- uipath 입문
- Uipath 설치방법
- 날짜 정규식
- Today
- Total
목록전체 글 (384)
콘솔워크
def remove_special_cha(content: str): new_str = re.sub(r"[^\uAC00-\uD7A30-9a-zA-Z\s,.!?;]", "", content) print(new_str) return new_str 일부 자주 사용하는 특수문자 (,./!?;) 와 띄어쓰기 (\s)를 하나씩 추가해줬다.
https://rapidapi.com/smodin/api/rewriter-paraphraser-text-changer-multi-language Smodin - Text Rewriter, Paraphraser, & Spinner API | RapidAPI Our rewriter changes the syntax, structure, word/phrase order, and uses synonyms when relevant. This rewriter works in in all major languages (english, german, spanish, french, arabic, Chinese, and many more). Max character count of 10,000. Questions? See..

'google cloud API'를 이용하려면 'service_secret_key.json'파일이 필수적으로 필요하다. 파일의 예시 { "type": "service_account", "project_id": "your-project", "private_key_id": "your-key-id", "private_key": "-----BEGIN PRIVATE KEY-----\nYOUR PRIVATE KEY\n-----END PRIVATE KEY-----\n", "client_email": "your-mail@your-mail.iam.gserviceaccount.com", "client_id": "your-client-id", "auth_uri": "https://accounts.google.com/o/oa..

https://newspaper.readthedocs.io/en/latest/ Newspaper3k: Article scraping & curation — newspaper 0.0.2 documentation Newspaper3k: Article scraping & curation Inspired by requests for its simplicity and powered by lxml for its speed: “Newspaper is an amazing python library for extracting & curating articles.” – tweeted by Kenneth Reitz, Author of requests “Newspap newspaper.readthedocs.io 라이브러리 설..
배열 합치기 a_list = ['1', '2', '3'] b_list = ['4', '5', '6'] sum_list = a_list + b_list print(sum_list) # ['1', '2', '3', '4', '5', '6'] 특정 요소 제거 sum_list.remove('3') sum_list.remove('5') print(sum_list) # ['1', '2', '4', '6']
def get_chrome_driver_new(is_headless=False, is_scret=False, tor=False): options = Options() if is_headless: options.add_argument("--headless") if is_scret: options.add_argument("-incognito") # 시크릿 모드 if tor: options.add_argument("--proxy-server=socks5://127.0.0.1:9150") # 토르 적용 options.add_argument("--disable-gpu") options.add_argument("lang=ko_KR") options.add_argument( "user-agent=Mozilla/5.0..
data = [ {'name': 'sravan', 'subjects': ['java', 'python']}, {'name': 'bobby', 'subjects': ['c/cpp', 'java']}, {'name': 'ojsawi', 'subjects': ['iot', 'cloud']}, {'name': 'rohith', 'subjects': ['php', 'os']}, {'name': 'gnanesh', 'subjects': ['html', 'sql']} ] # 모든 데이터 출력 print(data) # 출력 결과 [{'name': 'sravan', 'subjects': ['java', 'python']}, {'name': 'bobby', 'subjects': ['c/cpp', 'java']}, {'na..
https://www.torproject.org/download/languages/ The Tor Project | Privacy & Freedom Online Defend yourself against tracking and surveillance. Circumvent censorship. www.torproject.org 이 곳에서 자신의 환경에 맞게 다운로드하고 브라우저를 실행한다. 그 후 웹드라이버의 옵션을 설정하는 부분에서 def get_chrome_driver_new(is_headless=False, is_scret=False, tor=False): options = Options() # options.add_experimental_option("debuggerAddress", "127.0.0..
def login(self): driver = self.driver try: driver.get(f"https://nid.naver.com/nidlogin.login?url=https://section.cafe.naver.com/ca-fe") time.sleep(1) driver.execute_script( f"document.querySelector('input[id=\"id\"]').setAttribute('value', '{self.naver_id}')" ) time.sleep(1) driver.execute_script( f"document.querySelector('input[id=\"pw\"]').setAttribute('value', '{self.naver_pw}')" ) time.sleep..
list = [dict(t) for t in {tuple(d.items()) for d in list}]
self.tablewidget = QTableWidget() # 2개의 열 추가 self.tablewidget.setColumnCount(2) self.tablewidget.setHorizontalHeaderLabels(["번호", "이름"]) item_list = [{'번호': '1', '이름': '111'}, {'번호': '2', '이름': '222'}] for i, item in enumerate(item_list): num = item['번호'] name = item['이름'] self.tablewidget.setItem(i, 0, QTableWidgetItem(num)) self.tablewidget.setItem(i, 1, QTableWidgetItem(name))
document.evaluate('//your_xpath', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click()

=IMPORTRANGE(스프레드시트_URL, 범위_문자열) # =IMPORTRANGE("https://docs.google.com/spreadsheets/d/시트url","CompanyCode!A:H") 함수 설명: https://docs.google.com/spreadsheets/d/시트url에서 CompanyCode 시트의 A열부터 H열의 모든 자료를 참고합니다.

from enum import Enum class Number(Enum): one = 1 two = 2 three = 3 print(f'{Number.one.value} {type(Number.one.value)}') print(f'{Number.two.value} {type(Number.two.value)}') print(f'{Number.three.value} {type(Number.three.value)}') 그냥 변수로 지정하면 되는거 아닌가요? 왜 굳이 이런식으로 코딩하나요? 특정 상태를 하나의 집합으로 만들어 관리하기 때문에 코드를 정리하는데 도움이 됩니다. 한번 정의 해놓으면 여러곳에서 이용할 수 있기 때문에 불필요한 코딩을 방지합니다. 추 후 해당 값 이용할 때, 이상한 값이나 형태가 들어..

관리자권한으로 cmd 실행 cmd 창에 아래 명령어 입력 wmic path SoftwareLicensingService get OA3xOriginalProductKey OA3xOriginalProductKey로 20자리 제품키가 나옴 정품인증 확인 명령어 slmgr /xpr 참조: https://blog.naver.com/PostView.naver?blogId=ppagppag17&logNo=222527399031&parentCategoryNo=&categoryNo=8&viewDate=&isShowPopularPosts=true&from=search
import re test_html = 'hi' def findtags(text): # make this non capturing group return re.findall(r"]+>", text) tags = findtags(test_html) for tag in tags: simple_tag = re.sub(r"(]+(>)", r"\1\2", tag) test_html = test_html.replace(tag, simple_tag) print(test_html)
str 형태의 html 안에서 img 태그를 제거할 일이 생겼다 코드는 다음과 같다. import re def findtags(text): # make this non capturing group parms = '(?:\w+\s*=\s*"[^"]*"\s*)*' tags = "()" return re.findall(tags, text) def remove_img_tag_in_html(text: str): tags = findtags(text) for tag in tags: tag = str(tag) if tag.find("
#!/usr/bin/env python from http import HTTPStatus import bcrypt import pybase64 import requests import json import time import os from mimetypes import MimeTypes # from common.utils import get_mime_type def get_mime_type(file_path): mime = MimeTypes() mime_type, encoding = mime.guess_type(file_path) return mime_type class CommerceAPI: def __init__(self, client_id, client_secret): self.main_url =..
#!/usr/bin/env python from http import HTTPStatus import bcrypt import pybase64 import http.client import requests import json import time import os from common.utils import get_mime_type class CommerceAPI: def __init__(self, client_id, client_secret, account_id=""): self.main_url = f"https://api.commerce.naver.com" self.client_id = client_id self.client_secret = client_secret self.account_id = ..

account_id="" print('SELLER' if account_id!="" else 'SELF') 조건에 만족하면 왼쪽의 SELLER출력 그렇지 않으면 오른쪽의 SELF출력
[우커머스 REST_API] API키발급: https://woocommerce.com/document/woocommerce-rest-api RESTAPI 설명서: https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction WooCommerce REST API Documentation - WP REST API v3 Introduction WooCommerce (WC) 2.6+ is fully integrated with the WordPress REST API. This allows WC data to be created, read, updated, and deleted using requests in JSON format and using..
copy_df = df_original[0:0] print(copy_df) 원본 데이터프레임의 0행에서 0행까지의 데이터를 복사하는 식으로 해결 가능

# 오류 발생 시 프로그램 강제종료 방지 def my_exception_hook(exctype, value, traceback): print(exctype, value, traceback) global_log_append(str(value)) sys._excepthook(exctype, value, traceback) sys.excepthook = my_exception_hook

call-by-value (값을 복사해서 사용) 해당 방식은 함수를 호출할 때 전달되는 변수의 값을 복사하여 함수의 인자로 전달된다. 복사된 인자는 함수 안에서 사용되는 local value의 특성을 가진다. 따라서 함수 안에서 인자의 값이 바뀌어도, 외부 변수의 값은 변경되지 않는다. call-by-reference (값을 직점 참조) 함수가 호출되면, 메모리에 함수를 위한 임시공간이 생성되고, 함수가 종료되면 그 공간은 사라진다. 해당 방식은 함수 호출시 인자로 전달되는 변수의 주소를 전달한다. 따라서 인자의 값이 변경되면, 전달된 객체의 값도 변경된다. call-by-assignment (파이썬의 방식) 파이썬의 경우에는 call-by-assignment 방식을 사용한다. 파이썬에서는 모든 것이 객..
dataframe을 이용하여 query를 하려고 하는데, 데이터 안에 문자형이 들어가 있어서 Type Error가 나왔다. 오류메시지 TypeError: '>' not supported between instances of 'str' and 'int' 이럴때는 datafame 안에 원하지 않는 값 (숫자가 아닌 값을 필터링 하는 작업이 필요하다) df_ad_result = df_ad_result[ pd.to_numeric(df_ad_result["monthlyMobileQcCnt"], errors="coerce").notnull() ] 이렇게 해주면 데이터 유효성을 통한 필터링이 가능하다. 그 후에 query를 진행한다. str_expr = "(monthlyMobileQcCnt > 3000)" # 나이가..
from PyQt5.QtWidgets import * from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import * from PyQt5.QtGui import * class MainUI(QDialog): def __init__(self): super().__init__() self.setWindowFlags(Qt.WindowCloseButtonHint | Qt.WindowMaximizeButtonHint | Qt.WindowMinimizeButtonHint)

1. 스마트폰과 연결하기 위해 구글 개발자 페이지에서 adb (android device bridge)를 설치합니다. https://developer.android.com/studio/releases/platform-tools?hl=ko#downloads SDK 플랫폼 도구 출시 노트 | Android 개발자 | Android Developers Android SDK 플랫폼 도구는 Android SDK의 구성요소입니다. developer.android.com 1-1. 윈도우 환경변수에 해당 폴더 추가 2. 자신의 파이썬 작업환경에서 pure-python-adb를 설치합니다. pip install pure-python-adb 3. 안드로이드 스마트폰에서 개발자모드 활성화 및 USB 디버깅 모드 허용 위 작..
.gitignore파일 추가 삭제 만약 프로젝트가 진행중인 상황에서 버전관리를 하기 위해 .gitignore를 추가할 경우 이미 ignore된 파일들은 올라가있을 확률이 높다. git rm -r --cached . git add . git commit -m "커밋 메시지"
# str로 되어있는 날짜 start_date = '2022-01-01' # 위의 형식에 맞게 날짜로 형변환 start_date = datetime.strptime(start_date, f'%Y-%m-%d') # QDateEdit에 넣기 위해 QDate로 형변환 Q_start_date = QDateEdit(QDate(start_date))

my_list = ['1', '1', '1', '2', '3', '4', '4', '5', '6'] if len(my_list) == 0: print(f"결과가 없습니다.") else: print(f"{my_list}") print(f"{len(my_list)}") for el1, el2 in zip(my_list, my_list[1:]): if el1 == el2: print(el1, el2) my_list.remove(el1) print(f"{el1} 제거") my_list = list(set(my_list)) print(f"중복 제거 후 {len(my_list)}개의 주소") print(my_list)