for model_index in self.tableWidget.selectionModel().selectedRows():
row = model_index.row()
2019년 12월 19일 목요일
2019년 10월 28일 월요일
[Python] python 으로 프로그램 목록 구하기
import win32com.client strComputer = "." objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2") colItems = objSWbemServices.ExecQuery("Select * from Win32_Product") for objItem in colItems: print "Caption: ", objItem.Caption print "Description: ", objItem.Description print "Identifying Number: ", objItem.IdentifyingNumber print "Install Date: ", objItem.InstallDate print "Install Date 2: ", objItem.InstallDate2 print "Install Location: ", objItem.InstallLocation print "Install State: ", objItem.InstallState print "Name: ", objItem.Name print "Package Cache: ", objItem.PackageCache print "SKU Number: ", objItem.SKUNumber print "Vendor: ", objItem.Vendor print "Version: ", objItem.Version
2019년 8월 20일 화요일
[python] pyqt5 isSignalConnected
특정 시그널에 연결 되어 있는지를 확인
def isSignalConnected(_obj, signal_name):
def isSignalConnected(_obj, signal_name):
metaObj = _obj.metaObject()
for i in range(metaObj.methodCount()):
meta_method = metaObj.method(i)
if meta_method.methodType() == QMetaMethod.Signal:
if meta_method.name().data().decode('utf8') == signal_name:
return True
return False
2019년 8월 12일 월요일
apache 에서 django 서비스
sudo vim /etc/hosts
xxx.xxx.xxx.xxx demo
sudo vim /etc/apache2/sites-available/000-default.conf
<VirtualHost *:9000>ServerName demoWSGIDaemonProcess demo python-path=/home/user/PycharmProjects/mysite/venv/lib/python3.6/site-packagesWSGIProcessGroup demoWSGIScriptAlias / /home/user/PycharmProjects/mysite/mysite/wsgi.py process-group=demo<Directory /home/user/PycharmProjects/mysite/mysite><Files wsgi.py>Require all granted</Files></Directory>Alias /media/ /home/user/PycharmProjects/mysite/media/<Directory /home/user/PycharmProjects/mysite/media>Require all granted</Directory>Alias /static/ /home/user/PycharmProjects/mysite/.static_root/<Directory /home/user/PycharmProjects/mysite/.static_root>Require all granted</Directory><Directory /home/user/PycharmProjects/mysite/venv/lib/python3.6/site-packages>Require all granted</Directory><Directory /home/user/PycharmProjects/mysite>Require all granted</Directory><Directory /home/user/PycharmProjects/mysite/demo>Require all granted</Directory>ErrorLog /home/user/PycharmProjects/mysite/logs/error.logCustomLog /home/user/PycharmProjects/mysite/logs/access.log combined</VirtualHost>
2019년 3월 5일 화요일
QGIS3 PyCharm 설정
1. C:\Program Files\QGIS 3.4\etc\ini\python-core.bat
- File > Settings > Project: xxxx > Project Interpreter
- C:\Program Files\QGIS 3.4\bin\python3.exe
- C:\Program Files\QGIS 3.4\bin\pythonw3.exe
- C:\Program Files\QGIS 3.4\apps\Python37\python.exe
- C:\Program Files\QGIS 3.4\apps\Python37\pythonw.exe
중 하나 ㅡㅡ;
SET PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37
PATH %OSGEO4W_ROOT%\apps\Python37\Scripts;%PATH%2. pyQgis-PyCharm.bat
SET OSGEO4W_ROOT=C:\Program Files\QGIS 3.4
SET QGIS_HOME=%OSGEO4W_ROOT%
CALL "%OSGEO4W_ROOT%\bin\o4w_env.bat"
CALL "%OSGEO4W_ROOT%\bin\qt5_env.bat"
CALL "%OSGEO4W_ROOT%\bin\py3_env.bat"
set PATH=%OSGEO4W_ROOT%\apps\qgis-ltr;%PATH%
set PATH=%OSGEO4W_ROOT%\apps\qgis-ltr\bin;%PATH%
set PATH=%OSGEO4W_ROOT%\apps\qgis-ltr\python;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%/apps/qgis-ltr
set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\qgis-ltr\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis-ltr\python
SET PYCHARM="C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.2\bin\pycharm64.exe"
start "PyCharm aware of QGIS" /B %PYCHARM% %*3. PyCharm
- File > Settings > Project: xxxx > Project Interpreter
- C:\Program Files\QGIS 3.4\bin\python3.exe
- C:\Program Files\QGIS 3.4\bin\pythonw3.exe
- C:\Program Files\QGIS 3.4\apps\Python37\python.exe
- C:\Program Files\QGIS 3.4\apps\Python37\pythonw.exe
중 하나 ㅡㅡ;
2019년 2월 22일 금요일
브라우저에서 어플리케이션 실행
1. regedit
2. 컴퓨터\HKEY_CLASSES_ROOT\test
- test -------------------> 새로만들기 -> 키
|- shell -------------------> 새로만들기 -> 키
|- open -------------------> 새로만들기 -> 키
|- command -------------------> 새로만들기 -> 키
|- DefaultIcon -------------------> 새로만들기 -> 키
- test
- (기본값), REG_SZ, "GEODT"
- URL Protocol, REG_SZ, "" ------------------> 새로만들기 -> 문자열 값
- shell
- (기본값), REG_SZ, (값 설정 안 됨)
- open
- (기본값), REG_SZ, (값 설정 안 됨)
- command
- (기본값), REG_SZ, "C:\Program Files\test.exe" "%1"
- DefaultIcon
- (기본값), REG_SZ, "test.ext,1"
2. 컴퓨터\HKEY_CLASSES_ROOT\test
- test -------------------> 새로만들기 -> 키
|- shell -------------------> 새로만들기 -> 키
|- open -------------------> 새로만들기 -> 키
|- command -------------------> 새로만들기 -> 키
|- DefaultIcon -------------------> 새로만들기 -> 키
- test
- (기본값), REG_SZ, "GEODT"
- URL Protocol, REG_SZ, "" ------------------> 새로만들기 -> 문자열 값
- shell
- (기본값), REG_SZ, (값 설정 안 됨)
- open
- (기본값), REG_SZ, (값 설정 안 됨)
- command
- (기본값), REG_SZ, "C:\Program Files\test.exe" "%1"
- DefaultIcon
- (기본값), REG_SZ, "test.ext,1"
2019년 2월 21일 목요일
[QGIS3]pyqgis 좌표계 변경
_layer = iface.activeLayer()
a = _layer.sourceCrs()
b = QgsCoordinateReferenceSystem("EPSG:5186")
_layer.setCrs(b)
mapCanvas = iface.mapCanvas()
extMap = mapCanvas.extent()
transform = QgsCoordinateTransform(a, b, QgsProject.instance())
extMap = coordTrans.transform(extMap, QgsCoordinateTransform.ForwardTransform)
mapCanvas.setDestinationCrs(b)
mapCanvas.freeze(False)
mapCanvas.setExtent(extMap
a = _layer.sourceCrs()
b = QgsCoordinateReferenceSystem("EPSG:5186")
_layer.setCrs(b)
mapCanvas = iface.mapCanvas()
extMap = mapCanvas.extent()
transform = QgsCoordinateTransform(a, b, QgsProject.instance())
extMap = coordTrans.transform(extMap, QgsCoordinateTransform.ForwardTransform)
mapCanvas.setDestinationCrs(b)
mapCanvas.freeze(False)
mapCanvas.setExtent(extMap
피드 구독하기:
글 (Atom)
docker redmine 설치
docker-composer.yml version: '3.1' services: redmine: image: redmine restart: always container_na...
-
용량이 큰 파일 업로드 시 net::ERR_CONNECTION_RESET 오류 발생할 경우. http_server = tornado.httpserver.HTTPServer(app, max_buffer_size=10485760000) upload_for...
-
docker-composer.yml version: '3.1' services: redmine: image: redmine restart: always container_na...
-
# !-*- coding:utf-8 -*- import os import sys from PyQt5 import uic from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QDialog , QAppl...