'프로그래밍/python'에 해당되는 글 4건

  1. 2017.06.20 넘파이 행렬 인덱스 1
  2. 2017.02.07 python 버전 올리기
  3. 2017.02.03 PyQt5 1 Introduction
  4. 2017.02.03 PyQt5 0 Tutorial 2

자꾸 헥갈려서 정리한다.

다음과 같이 4차원 행렬을 만들어서 테스트 해보면

 

아래 첫번째 이미지의 연산은 각 axis별 데이터, 아래편은  axis 별 더하기.

raw, column, depth 나 x, y, z 등으로 접근하면 더 헥갈리는 것 같고

차라리 바깥 쪽부터의 큰 덩어리로 계산하는게 차원이 높아졌을 때도 편한 것 같다.

더하기와 같은 연산의 경우, 예를 들면 sum( 0(axis) )라고 하면 0 축으로 두 덩어리가 있으니 그대로

더하면 된다. 4*5 행렬 3덩어리이니 각 위치 60개의 숫자를 더하는 것이다. sum( 2 ) 이면 3번째 덩어리, 즉  위 그림에서 보면 원소가 5개인 벡터가 4줄 씩 1덩어리를 이루고 그 덩어리가 2개 있다. 제일 윗줄에 있는 4개의 벡터를 그대로 더하면 답의 첫 줄이 된다. [ 0+5+10+15, 1+6+11+16, 2+7+12+17, 3+8+13+18, 4+9+14+19 ] 가 된다. 

  

'프로그래밍 > python' 카테고리의 다른 글

python 버전 올리기  (0) 2017.02.07
PyQt5 1 Introduction  (0) 2017.02.03
PyQt5 0 Tutorial  (2) 2017.02.03
Posted by 게 르 니 카

우분투 16.04 LTS를 설치하면 파이썬이 2.7.12가 기본 설치되어 있다.

요즘은 주로 3.5를 사용하는 것 같아 버전 업을 시도한다.


sudo add-apt-repository ppa:fkrull/deadsnakes

sudo apt update

sudo apt install python3.5


/usr/bin/ 폴더에 가서 ls -al py* 쳐보면 파이썬 관련해서 버전별로 설치된 것, 링크 다 보인다.

.bashrc 에 다음 한 줄 추가하면 끝.


alias python='/usr/bin/python3'


'프로그래밍 > python' 카테고리의 다른 글

넘파이 행렬 인덱스 1  (0) 2017.06.20
PyQt5 1 Introduction  (0) 2017.02.03
PyQt5 0 Tutorial  (2) 2017.02.03
Posted by 게 르 니 카

Introduction to PyQt5 파이큐티5 소개

This is an introductory PyQt5 tutorial. The purpose of this tutorial is to get you started with the PyQt5 toolkit. The tutorial has been created and tested on Linux. PyQt4 tutorial covers PyQt4, which is a blending of the Python language (2.x and 3.x) to the Qt4 library.
파이큐티5 지침서의 소개부분이다. 이 지침서의 목적은 여러분이 파이큐티5 툴킷을 시작할 수 있게 하는 것이다. 이 지침서는 리눅스 상에서 만들어지고 테스트되었다.  파이큐티4 지침서는 파이썬2, 3과 큐티4 라이브러의 결합을 다룬  파이큐티4에 대한 내용이다.

About PyQt5 파이큐티5란?

PyQt5 is a set of Python bindings for Qt5 application framework from Digia. It is available for the Python 2.x and 3.x. This tutorial uses Python 3. Qt library is one of the most powerful GUI libraries. The official home site for PyQt5 is www.riverbankcomputing.co.uk/news. PyQt5 is developed by Riverbank Computing.
파이큐티5는 디지아가 만든 큐티5 애플리케이션 프레임워크와 파이썬을 결합시키는 묶음이다. 파이썬 2, 3에 사용할 수 있다. 이 지침서는 파이썬3를 사용한다. 큐티 라이브러리는 가장 강력한 GUI 라이브러리의 하나이다.공식적인 파이큐티5의 주소는 www.riverbankcomputing.co.uk/news 이 곳이다. 파이큐티5는 리버뱅크컴퓨팅사에 의해 개발되었다.  

PyQt5 is implemented as a set of Python modules. It has over 620 classes and 6000 functions and methods. It is a multiplatform toolkit which runs on all major operating systems, including Unix, Windows, and Mac OS. PyQt5 is dual licensed. Developers can choose between a GPL and a commercial license.
 파이큐티5는 파이썬 모듈의 묶음으로 구현되었다. 파이큐티5는 620개 이상의 클래스와 6000개 이상의 함수 또는 메소드들로 구성되었다. 파이큐티5는 주요 운영체제, 유닉스, 윈도우, 맥OS 등등 에서 모두 구동가능한 멀티플랫폼 툴킷이다. 파이큐티5는 두가지 라이센스 방식을 가지고 있다. 개발자들은 GPL 방식이나 상업용 라이센스를 선택할 수 있다.     

PyQt5's classes are divided into several modules, including the following:
파이큐티5의 클래스들은 아래의 모듈을 포함해서 여러개의 모듈로 나뉘어 있다.

  • QtCore
  • QtGui
  • QtWidgets
  • QtMultimedia
  • QtBluetooth
  • QtNetwork
  • QtPositioning
  • Enginio
  • QtWebSockets
  • QtWebKit
  • QtWebKitWidgets
  • QtXml
  • QtSvg
  • QtSql
  • QtTest

The QtCore module contains the core non GUI functionality. This module is used for working with time, files and directories, various data types, streams, URLs, mime types, threads or processes.
큐티코어 모듈은 GUI 외의 핵심적인 기능을 담고 있다. 이 모듈은 시간, 파일, 폴더, 다양한 데이타 타입, 스트림, URL, MIME타입, 쓰레드 또는 프로세스 등을 처리하기 위해 사용된다. 

The QtGui contains classes for windowing system integration, event handling, 2D graphics, basic imaging, fonts and text.
큐티구이는 윈도우 시스템의 전반적인 내용, 이벤트 핸들링, 2D그래픽, 기본적인 이미지 관련 작업, 폰트, 텍스트 처리 등을 위한 클래스들을 포함하고 있다.

The QtWidgets module contains classes that provide a set of UI elements to create classic desktop-style user interfaces.
큐티위젯은 고전적인 데스크탑 스타일 UI를 만드는 다양한 요소들을 제공한다. 

The QtMultimedia contains classes to handle multimedia content and APIs to access camera and radio functionality.
큐티멀티미디어는 카메라나 라디오 기능에 접근 가능한 멀티미디어 관련 기능이나 API를 제공하는 클래스들을 포함하고 있다.  

The QtBluetooth module contains classes to scan for devices and connect and interact with them.
큐티블루투스는 블루투스 장치들을 스캔하고 연결해서 서로 정보를 주고받을 수 있는 클래스들을 포함하고 있다.   

The QtNetwork module contains the classes for network programming. These classes facilitate the coding of TCP/IP and UDP clients and servers by making the network programming easier and more portable.
큐티네트워크는 네트웍 프로그래밍 관련 클래스들을 포함하고 있다. 이 클래스들은 TCP/IP나  UDP 클라이언트, 서버 코딩을 활용해서 네트웍 프로그래밍을 더 쉽고 간편하게 만드는 클래스들이다.

The QtPositioning contains classes to determine a position by using a variety of possible sources, including satellite, Wi-Fi, or a text file.
큐티포지셔닝은 인공위성, 와이파이, 텍스트파일 등등 가능한 모든 자원을 사용하여 위치를 결정할 수 있는 클래스들을 포함하고 있다.  

The Enginio module implements the client-side library for accessing the Qt Cloud Services Managed Application Runtime.
이엔지엔아이오 모듈은 애플리케이션이 구동될 때 유지되는 큐티 클라우드 서비스에 접근할 수 있는 클라이언트 쪽 라이브러리를 구현해놓은 모듈이다.  

The QtWebSockets module contains classes that implement the WebSocket protocol.
큐티웹소켓은 웹소켓 프로토콜을 구현한 클래스들을 포함하고 있다.

The QtWebKit contains classes for a web browser implementation based on the WebKit2 library.
큐티웹킷은 웹킷2 라이브러리에 기반해서 구현해놓은 웹브라우저 관련 클래스들을 포함하고 있다.

The QtWebKitWidgets contains classes for a WebKit1 based implementation of a web browser for use in QtWidgets based applications.
큐티웹킷위젯은 큐티위젯으로 만든 애플리케이션을 위한 웹브라우저의 웹킷1 기반 구현을 위한 클래스들을 포함하고 있다. 

The QtXml contains classes for working with XML files. This module provides implementation for both SAX and DOM APIs.
큐티엑스엠엘은 XML파일을 처리하는 함수들을 포함하고 있다. 이 모듈은 SAX와 DOM API 를 위한 것들을 구현해놓았다.  

The QtSvg module provides classes for displaying the contents of SVG files. Scalable Vector Graphics (SVG) is a language for describing two-dimensional graphics and graphical applications in XML.
큐티에스브이지 모듈은 SVG파일의 내용을 디스플레이하기 위한 클래스들을 제공한다. 스케일러블 벡터 그래픽스는 2차원 그래픽스와 XML에 포함되어 있는 그래픽 응용프로그램을 위한 언어이다.   

The QtSql module provides classes for working with databases.
큐티에스큐엘은 데이타베이스 관련한 클래스들을 제공한다.  

The QtTest contains functions that enable unit testing of PyQt5 applications.
큐티테스트는 파이큐티5 응용프로그램의 유닛테스팅을 위한 함수들이 포함되어 있다.

PyQt4 and PyQt5 differences 파이큐티4와 파이큐티5의 차이

The PyQt5 is not backward compatible with PyQt4; there are several significant changes in PyQt5. However, it is not very difficult to adjust older code to the new library. The differences are, among others, the following:
파이큐티5는 파이큐티4와 하위호환이 되지 않는다. 파이큐티5에는 몇가지 중요한 변화가 있다. 그렇지만, 이전 코드를 새로운 라이브러리에 맞추는 작업이 어렵지는 않다. 그 중 주요한 차이점은 다음과 같다.

  • Python modules have been reorganized. Some modules have been dropped (QtScript), others have been split into submodules (QtGui, QtWebKit).
    파이썬 모듈이 재구성되었다. 파이스크립트 같은 모듈은 사용하지 않기로 했고 큐티구이나 큐티웹킷 같은 다른 모듈은 쪼개졌다.
  • New modules have been introduced, including QtBluetooth, QtPositioning, or Enginio.
    큐티블루투스, 큐티포지셔닝, 엔지엔아이오 같은 새로운 모듈이 추가되었다.
  • PyQt5 supports only the new-style signal and slots handlig. The calls to SIGNAL() or SLOT() are no longer supported.
    파이큐티는 새로운 방식의 시그날-슬롯 처리 방식을 지원한다. SIGNAL(), SLOT() 함수의 호출 같은 방식은 더 이상 지원하지 않는다. 
  • PyQt5 does not support any parts of the Qt API that are marked as deprecated or obsolete in Qt v5.0.
    파이큐티5는 큐티5.0에서 사용안하거나 더 이상 사용안할 것이라고 지정한 API들을 더 이상 지원하지 않는다. 

Python

python logoPython is a general-purpose, dynamic, object-oriented programming language. The design purpose of the Python language emphasizes programmer productivity and code readability. Python was initially developed by Guido van Rossum. It was first released in 1991. Python was inspired by ABC, Haskell, Java, Lisp, Icon, and Perl programming languages. Python is a high-level, general purpose, multiplatform, interpreted language. Python is a minimalistic language. One of its most visible features is that it does not use semicolons nor brackets. It uses indentation instead. There are two main branches of Python currently: Python 2.x and Python 3.x. Python 3.x breaks backward compatibility with previous releases of Python. It was created to correct some design flaws of the language and make the language more clean. The most recent version of Python 2.x is 2.7.9, and of Python 3.x is 3.4.2. Python is maintained by a large group of volunteers worldwide. Python is open source software. Python is an ideal start for those who want to learn programming.
파이썬은 범용적인, 동적이며, 객체지향적인 프로그래밍 언어이다. 파이썬 언의를 만든 목적은 프로그래머의 생산성과 코드 가독성을 높이기 위해서였다. 파이썬은 처음에 귀도 반 로썸에 의해 개발되었다. 1991년에 처음으로 발표되었다. 파이썬은 ABC,하스켈, 자바, 리스프, 아이콘, 펄 같은 언어에 영향을 받았다. 파이썬은 상위 레벨의, 범용적인, 멀티플랫폼용, 해석 언어이다. 파이썬은 필요한 기능만 최소한으로 구현되어 있는 언어이다. 눈에 띄는 특징 중에 하나는 세미콜론이나 괄호를 사용하지 않는다는 것이다. 대신 들여쓰기를 사용한다. 최근에 파이썬은 버전2.X와 버전3.X 두가지 갈래로 갈라져 있다. 파이썬3은 이전 버전과 호환되지 않는다. 그 이유는 언어의 디자인 상의 결점을 보완하고 조금 더 깨끗하게 정리하기 위해서 내린 결정이었다. 최신의 2 대 버전은 2.7.9이고 3 대 버전은 3.4.2이다. 파이썬은 전세계의 많은 자원자들 그룹에 의해서 유지되고 있다. 파이썬은 오픈소스 소프트웨어이다. 파이썬은 프로그래밍을 배우기 위한 사람들을 위한 이상적인 출발점이다.  

This tutorial uses Python 3.x version.
이 지침서는 파이썬 3.X 버전을 사용한다.

Python programming language supports several programming styles. It does not force a programmer to a specific paradigm. Python supports object-oriented and procedural programming. There is also a limited support for functional programming.
파이썬 프로그래밍 언어는 몇가지 프로그래밍 스타일을 지원한다. 파이썬은 개발자들에게 특정한 패러다임을 강요하지 않는다. 파이썬은 객체지향이든 절차적인 개발이든 다 지원한다. 함수적인 프로그래밍도 제한된 범위에서 지원한다.

The official web site for the Python programming language is python.org
파이썬 프로그래밍 언어의 공식 웹 사이트는 python.org 이다.

Perl, Python, and Ruby are widely used scripting languages. They share many similarities and they are close competitors.
펄, 파이썬, 루비는 널리 사용되는 스크립트형 언어이다. 이들은 많은 유사점도 있으며 긴밀하게 경쟁하고 있기도 하다. 

This chapter was an introduction to PyQt5 toolkit.
이 장은 파이큐티5 툴킷의 소개였다.

'프로그래밍 > python' 카테고리의 다른 글

넘파이 행렬 인덱스 1  (0) 2017.06.20
python 버전 올리기  (0) 2017.02.07
PyQt5 0 Tutorial  (2) 2017.02.03
Posted by 게 르 니 카

혼자 공부하다보니 자꾸 챗바퀴 도는 것 같아 정리하면서 공부하려고 작성한다.
서핑하다가 보니 젯코드( http://zetcode.com/gui/pyqt5/ )라는 사이트가 잘 만들어진 것 같아
일단 번역을 하려고 생각하고 있는데, 중간에 내용을 추가하거나 보완해서 '증보판'처럼 만드는 것도 나쁘지 않을 것 같다는 생각이 든다.

PyQt5 tutorial
파이큐티5 지침서

This is PyQt5 tutorial. The tutorial is suited for beginners and intermediate programmers. After reading this tutorial, you will be able to program non trivial PyQt5 applications.
아래 내용은 파이큐티5 지침서로 초급이나 중급 개발자에게 적당하다. 이 지침서를 읽고나서 당신은 의미있는 파이큐티5 응용프로그램을 만들수도 있을 것이다.

Table of contents
목차


'프로그래밍 > python' 카테고리의 다른 글

넘파이 행렬 인덱스 1  (0) 2017.06.20
python 버전 올리기  (0) 2017.02.07
PyQt5 1 Introduction  (0) 2017.02.03
Posted by 게 르 니 카
이전버튼 1 이전버튼

블로그 이미지
게 르 니 카

공지사항

Yesterday
Today
Total

달력

 « |  » 2024.5
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 31

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함