본문 바로가기

Web_Application

(94)
[python][mssql] query module, example import pymssql def execute(query): conn = pymssql.connect(server='{{SERVER_IP}}', user='{{USER_ID}}', password='{{PASSWORD}}', database='{{DB_NAME}}', charset='utf8') cursor = conn.cursor(as_dict=True) result_data = [] if conn: cursor.execute(query) index = 0 for row in cursor: result_data.insert(index, row) index = index + 1 else: pass conn.close() conn = None return result_data sql = "SELECT *..
[c#][linq][winform] combobox query foreach get index, value string selectValue = 저장된 값"; foreach (var item in {{combobox}}.Items.Cast().Select((value, index) => new { index, value })) { // item.value == selectValue 저장된 값 선택하기 if (item.value == selectValue) { {{combobox}}.SelectedIndex = item.index; break; } }
[python][win10] scrapy install error pip install scrapy #1 error: command 'cl.exe' failed: No such file or directory #2 C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h(10): fatal error C1083: 포함 파일을 열 수 없습니다. 'vcruntime.h': No such file or directory -> Visual Studio 2017 설치. #3 Could not find a version that satisfies the requirement win32api (from versions: ) -> pip install pypiwin32 https://stackoverflow..
[python][ubuntu] scrapy install error - setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 https://stackoverflow.com/questions/26053982/setup-script-exited-with-error-command-x86-64-linux-gnu-gcc-failed-with-exit/35164888 sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl ..
[c#][winform][Linq] 여러개의 콤보박스 선택 유무 체크하기 ComboBox cmb = this.Controls.OfType().Where(c => c.GetType() == typeof(ComboBox) && c.Name != {{콤보박스1}}.Name && c.Name != {{콤보박스2}}.Name && c.Name != {{콤보박스3}}.Name && c.SelectedIndex == 0).OrderBy(c => c.TabIndex).FirstOrDefault(); if (cmb != null) { MessageBox.Show("필수 항목을 선택해 주세요."); cmb.Focus(); return; }
[c#][winform] textbox 숫자만 입력 받기 private void textbox1_TextChanged(object sender, EventArgs e) { // 소숫점(.), 자리수(,)는 허용하고 기타 문자가 있으면 입력 초기화. 다른 특수문자를 허용하려면 숫자 뒤에 붙이기 if (Regex.IsMatch(textbox1.Text, "[^0-9.,]")){ textbox1.Text = ""; } }
[c#][winform] To Set Maximize / Minimize Button Enable/Disable form properties > MaximizeBox = True/False form properties > MinimizeBox = True/False
[python] excel 시트간 데이터 비교 후 서식으로 차이 표시 import sys import io import ctypes import json import win32api import datetime import pandas as pd #엑셀이 설치되어 있어야하며 path가 지정되어 있어야한다. wb = excel.Workbooks.Open('C:\\Users\\{{사용자계정}}\\Documents\\sample.xlsx') ws = wb.Worksheets("Sheet1") ws.Range('A1').PasteSpecial() #클립보드에 복사된 엑셀 데이터를 붙여넣기 한다.주석처리하고 수동으로 붙여넣기 해도 됨. ws.Columns('A:Z').AutoFit() wb.WorkSheets.Add() ws2 = wb.ActiveSheet ws2.Name = "S..