Rapid GUI Programming with Python and Qt download

c#小王子 c#小王子 2021-05-11 1123 Software,Python


Rapid GUI Programming with Python and Qt download


Foreword


As PyQt's creator, I'm delighted to see that this book has been written. Al- though I served as one of the book's technical reviewers, Im happy to confess that Ilearned a few things myself.


The PyQt documentation covers the APIs of all the PyQt classes. This book showsyou how touse all those classes, how to combine them to create dialogs, main windows,and entire applications—all of which look good and work well, with no arbitrary limits, and using a programming language that is a joy to use.


What Iparticularly like about the book is that the examples aren't trivialones designed to illustrate a simple point.but are potentially useful in their own right. The way that different approaches are considered will reward thereader who wants to develop a deeper understanding of how to apply PyQt to the development of large scale, production quality applications.


I began the PyQt story back in the late 1990s.Ihad been using Tcl/Tk for some time, but I felt that Tk applications looked ugly, especially when I saw what had been achieved with the first version of KDE.I had wanted to switch to Python, and so I thought I would combine the change of language with a change of GUI library.


Initially I used some wrappers that had been written using SWIG, but I con- cluded that I could produce a more suitable wrapper tool myself. Iset to work creating SIP, and released PyQt 0.1 supporting Qt 1.41 in November 1998. Development has continued regularly ever since, both to keep up with new re- leases of Qt and to broaden the scope of PyQt with.for example,the addition of support tools and improved documentation. By 2000, PyQt 2.0 supported Qt 2.2 on both Linux and Windows. Qt 3 support appeared in 2001, and Mac OSXsupportin 2002.The PyQt4 series began with PyQt 4.0 in June 2006 with support for Qt 4.


My primary goal has always been to allow Python and Qt to work together in a way that feels natural to Python programmers, while allowing them to do anything they want in Python that can be done in C++.The key to achieving this was the development of SIP. This gave me a specialized code generator over which I had complete control and ensures that Python and Qt will always fit snugly together.


The essential process of developing and maintaining PyQt is now well estab lished. Much of the workisnow automated, which meansthatkeepingup with new releases of Qt from Trolltechis nolonger the problem itonce was,anden- surs that PyQt will continue for years to come.


It'sbeen very gratifying to watch the growth of the PyQt community over the years. If this bookispart of yourintroduction to PyQt,then welcome!


一 Phil Thompson Wimborne, Dorset, U.K.

August 25,2007


Introduction


This book teaches how to write GUI applications using the Python program- ming language and the Qt application development framework. The only essential prior knowledge is thatyou can program in some object-oriented pro gramminglanguage,such as C++, C#,Java,or of course,Python itself. For the rich text chapter, some familiarity with HTML and with regular expressionsis assumed,andthe databases and threading chapters assume some basicknowl edge of those topics. A knowledge of GUI programming is not required, since all the key concepts are covered.


The book will be useful to people who program professionally as part of their job, whether as full-time software developers,or those from other disciplines, including scientists and engineers, who need to do some programming in sup- port of their work. It is also suitable forundergraduate and post-graduatestu- dents,particularly those doing courses or research that includes a substantial computing element. The exercises (with solutions) are provided especially to help students.


Python is probably the easiest to learn and nicest scripting language in widespreaduse,and Qtis probably the bestlibrary for developing GUIapplica- tions. The combination of Python and Qt,"PyQt",makesit possible to develop applications on any supported platform and run them unchanged on all the supported platforms—for example, all modern versions of Windows, Linux, Mac OS X,and most Unix-based systems. No compilation is required thanks to Python being interpreted, and no source code changes to adapt to different operating systems are required thanks to Qt abstracting away the platform- specific details. We only have to copy the source file or files to a targetmachine that has both Python and PyQt installed and the application will run.


If you are new to Python: Welcome! You are about to discover a language that is clear to read and write, and that is concise without being cryptic. Python supports many programming paradigms,but because our focus is on GUJI programming, we will take an object-oriented approach everywhere except in the very early chapters.


Python is a very expressive language, which means that we can usually write far fewer lines of Python code than would be required for an equivalent appli- cation written in,say, C++orJava. This makes it possible to show some small but complete examples throughout the text,and makes PyQt an ideal tool for rapidly and easily developing GUI applications,whether for prototyping or for production use.



Since the emphasis of the book is on GUI programming, Part I provides a fast-paced Python tutorial as well as some PyQt coverage. This material is clearly marked (just like this paragraph, with "Qt"in the margin) to make it easy for experienced Python programmers to skip the Python they already know. Parts II, III, and IV of the book are all PyQt-specific and assume that readers can already program in Python, whether from previous experience or from reading Part I.


Quite often in programming we reach decision points when there are several possible approaches we could take. Reference books and the online documen- tation identify what classes,methods, and functions are available.and in some cases provide examples, but such documents rarely provide a broader context. This book gives the necessary context, highlighting the key decision points for GUI programming and offering insights into the pros and cons so that you can decide for yourself what the right policy is for your particular circumstances. For example, when you create a dialog, should it be modal or modeless?(See Chapter 5 for an explanation and policy recommendations on this issue.) PyQt is used to write all kinds of GUI applications, from accounting appli- cations, to visualization tools used by scientists and engineers. Figure 1, for example,shows Eric4,a powerful integrated development environment that is written in PyQt. It is possible to write PyQt applications that arejust tens of lineslong,and medium-size projects of 1000 to 10000 lines are very common. Some commercial companies have built 100 000-line PyQt applications, with programming teams varying in size fromjust one person to more than a dozen people. Many in-house tools are written using PyQt, but because these are of- ten used to gain competitive advantage, the companies involved generally do not permit their use of PyQt tobe made public. PyQt is also widelyused in the open source world, with games, utilities, visualization tools, and IDEs all writ- ten using it.


This book is specifically about PyQt4, the Python bindings for the Qt 4 C++ application development framework* PyQt4 is provided in the form of ten Python modules which between them contain around 400 classes and about 6000 methods and functions. All the example programs have been tested on Windows, Linux, and Mac OS X, using Python 2.5,Qt 4.2, and PyQt 4.2, and additionally on Windows and Linuxusing Qt 4.3 and PyQt 4.3.Backporting to earlier versions is possible in some cases, but we recommend using the most up-to-date versions of Python, Qt, and PyQt.

Python, PyQt,and Qt can be used free of charge for noncommercial purposes, but the license used by Python is different from that used by PyQt and Qt. Python is available with a very liberal license that allows it to be used to de velopboth commercialand noncommercialapplications. Both PyQt and Qt are dual-licensed: This essentially allows them to be used to develop noncommer- cial applications—which must in turn be licensed using an acceptable open sourcelicense such as the GNU General Public License (GPL);or to be used to develop commercialapplications—-in this case, a commercial PyQt licenseand a commercial Qt license must be purchased.


The Structure of the Book


The bookis dividedintofour parts. PartIisprimarily arapidconversion course aimed at non-Python programmers who are familiar with an object-oriented language, although it also has some (clearly marked) PyQt content. Because the core Python language is mostly simple and is quite small, these chapters can teach the basics of Python to a sufficient extent that real Python applica- tions can be written.


If you think that you can pick up the Python syntax simply through reading it, you might be tempted to skip Part I and dive straight into the GUI pro gramming that begins in Part II.The early chapters in Part II include back- references to the relevant pages in Part I to support readers who choose this approach. However, even for readers familiar with Python, we recommend reading about QString in Chapter 1.If you areunfamiliar with partialfunction application (currying),itis important to read the subsection that covers this in Chapter 2,since this technique is sometimes used in GUI programming.


【Download link】

link:https://pan.baidu.com/s/1f5n-Q-fAgzA8wo8Q2SB0Zw

Extraction code:r5li



相关文章


visualizing data(PDF download)

In this book,I wanted to offer something for people who want to get

Rapid GUI Programming with Python and Qt download

This book is specifically about PyQt4, the Python bindings for the Qt


文章热度: 166291
文章数量: 333
推荐阅读

FlashFXP绿色版网盘下载,附激活教程 1924

FlashFxp百度网盘下载链接:https://pan.baidu.com/s/1MBQ5gkZY1TCFY8A7fnZCfQ。FlashFxp是功能强大的FTP工具

Adobe Fireworks CS6 Ansifa绿色精简版网盘下载 1665

firework可以制作精美或是可以闪瞎眼的gif,这在广告领域是需要常用的,还有firework制作下logo,一些原创的图片还是很便捷的,而且fireworks用法简单,配合dw在做网站这一块往往会发挥出很强大的效果。百度网盘下载链接:https://pan.baidu.com/s/1fzIZszfy8VX6VzQBM_bdZQ

navicat for mysql中文绿色版网盘下载 1699

Navicat for Mysql是用于Mysql数据库管理的一款图形化管理软件,非常的便捷和好用,可以方便的增删改查数据库、数据表、字段、支持mysql命令,视图等等。百度网盘下载链接:https://pan.baidu.com/s/1T_tlgxzdQLtDr9TzptoWQw 提取码:y2yq

火车头采集器(旗舰版)绿色版网盘下载 1793

火车头采集器是站长常用的工具,相比于八爪鱼,简洁好用,易于配置。火车头能够轻松的抓取网页内容,并通过自带的工具对内容进行处理。站长圈想要做网站,火车头采集器是必不可少的。百度网盘链接:https://pan.baidu.com/s/1u8wUqS901HgOmucMBBOvEA

Photoshop(CS-2015-2023)绿色中文版软件下载 1916

安装文件清单(共46G)包含Window和Mac OS各个版本的安装包,从cs到cc,从绿色版到破解版,从安装文件激活工具,应有尽有,一次性打包。 Photoshop CC绿色精简版 Photoshop CS6 Mac版 Photoshop CC 2015 32位 Photoshop CC 2015 64位 Photoshop CC 2015 MAC版 Photoshop CC 2017 64位 Adobe Photoshop CC 2018 Adobe_Photoshop_CC_2018 Photoshop CC 2018 Win32 Photoshop CC 2018 Win64

知之

知之平台是全球领先的知识付费平台。提供各个领域的项目实战经验分享,提供优质的行业解决方案信息,来帮助您的工作和学习

使用指南 建议意见 用户协议 友情链接 隐私政策 Powered by NOOU ©2020 知之