Python ÇÁ·Î±×·¡¹Ö > PyQt5 - ¼³Ä¡&°³¹ß ½ÃÀÛÇϱâ
µî·ÏÀÏ : 2017-07-17 12:11
Á¶È¸¼ö : 53,346
ÆÄÀ̽㿡¼ GUI ÇÁ·Î±×·¡¹ÖÀ» Çϱâ À§Çؼ´Â wxPython, PyQt, TkInter µî°ú °°Àº ÆÐÅ°Áö°¡ ÇÊ¿äÇÕ´Ï´Ù.
±× Áß¿¡¼ TkInter Àº ÆÄÀ̽㠰ø½Ä GUI ÆÐÅ°Áö·Î ÇÁ·Î±×·¥ ¼³Ä¡ ¾øÀÌ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
Ãß°¡ ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÒ ÇÊ¿ä°¡ ¾ø°í ¹è¿ì±â ½ÍÁö¸¸ µðÀÚÀÎ Ä÷¸®Æ¼¿Í º¹ÀâÇÑ ÇÁ·Î±×·¥À» °³¹ßÇϱ⿡´Â ºÎÁ·ÇÕ´Ï´Ù.
±×·¡¼ Qt ¶ó´Â À̸§À¸·Î ºÒ¸®´Â PyQt GUI ÇÁ·¹ÀÓ¿öÅ©¸¦ ¸¹ÀÌ »ç¿ëÇÕ´Ï´Ù.
Qt ´Â Å©·Î½º Ç÷§Æû ÇÁ·¹ÀÓ¿öÅ©·Î ¿î¿µÃ¼Á¦¿¡ »ó°ü¾øÀÌ °°Àº ÄÚµå·Î µ¿ÀÛÇÕ´Ï´Ù.
pip3.exe ÆÄÀÏÀÌ Á¸ÀçÇÏ´Â Æú´õ·Î ÀÌ¿ëÇÏ¿© PyQt5 ¶óÀ̺ê¶ó·¯¸®¸¦ ¼³Ä¡ ÇÕ´Ï´Ù.
¾Æ·¡ ȸéó·³ pip3 install PyQt5 ¸í·ÉÀ» ÀÔ·ÂÇÏ¿© ¶óÀ̺귯¸®¸¦ ¼³Ä¡ÇÕ´Ï´Ù.
Lib / site-packages / PyQt5 Æú´õ¿¡ ¶óÀ̺귯¸®°¡ Àß ¼³Ä¡µÈ°ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
¼³Ä¡°¡ ³¡³µ´Ù¸é ÆÐÅ°Áö¸¦ ·ÎµùÇؼ ȸéÀ» ¶ç¿ö ºÁ¾ß°ÚÁÒ.
from ºÎºÐÀÌ PyQt4 ·Î ¾à°£ ´Ù¸£Áö¸¸ ³ª¸ÓÁö ¼Ò½º´Â °ÅÀÇ µ¿ÀÏÇÕ´Ï´Ù.
¾Æ·¡ ¼Ò½º¸¦ ÀÔ·ÂÇؼ ´ÙÀ̾ó·Î±× Æ˾÷âÀ» ¶ç¿ö º¸¼¼¿ä.
test.py
import sys
from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit,QInputDialog, QApplication)
app = QApplication([])
dialog = QInputDialog()
dialog.show()
app.exec_()
Á»´õ »ó¼¼ÇÏ°Ô ¾Ë°í ½Í´Ù¸é API ¹®¼¸¦ Âü°íÇϼ¼¿ä. API °¡À̵å ÁÖ¼Ò´Â ´ÙÀ½°ú °°½À´Ï´Ù.
http://pyqt.sourceforge.net/Docs/PyQt5/