您尚未登录。

楼主 #1 2018-06-29 18:18:25

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Python + Qt 入坑记录

https://www.python.org/ftp/python/3.7.0/python-3.7.0-amd64.exe

https://download.jetbrains.8686c.com/python/pycharm-professional-2018.1.4.exe


D:\Python\Python37\Scripts\pip3.exe install sip
D:\Python\Python37\Scripts\pip3.exe install PyQt5
D:\Python\Python37\Scripts\pip3.exe install PyQt5-tools





离线

楼主 #2 2018-06-30 08:37:45

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: Python + Qt 入坑记录

QQ20180630083706.png





离线

楼主 #3 2018-06-30 09:27:41

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: Python + Qt 入坑记录

下载并安装python3.7版本:

安装python软件包:

D:\Python\Python37\Scripts\pip3.exe install sip
D:\Python\Python37\Scripts\pip3.exe install PyQt5
D:\Python\Python37\Scripts\pip3.exe install PyQt5-tools

打开 Qt Designer, 随便设计一个窗体:
QQ20180630093754.png

根据 *.ui 生成 *.py 文件:

D:\Python\Python37\python.exe -m PyQt5.uic.pyuic test.ui -o test2.py

test2.py 最末添加:

import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
if __name__ == '__main__':
    app = QApplication(sys.argv)
    MainWindow = QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())

在命令行运行:

D:\Python\Python37\python.exe F:\pywin\test2.py

完美:
QQ20180630092857.png


源码下载: pywin_src.7z





离线

#4 2018-07-03 22:37:34

alan8918
会员
注册时间: 2018-06-26
已发帖子: 42
积分: 42

Re: Python + Qt 入坑记录

这个组合需要学习,特别是像我这么懒的人

离线

#5 2020-02-19 13:46:18

pythinker
会员
注册时间: 2019-02-12
已发帖子: 215
积分: 215

Re: Python + Qt 入坑记录

mark, Python Qt5 学习中 ...

离线

#6 2020-04-21 19:29:21

井蛙
会员
注册时间: 2019-09-11
已发帖子: 13
积分: 13

Re: Python + Qt 入坑记录

QML 比较不错





离线

#7 2020-05-08 11:19:41

wh0syourdaddy
会员
注册时间: 2020-05-08
已发帖子: 7
积分: 7

Re: Python + Qt 入坑记录

可以可以,最近也在玩这两个的组合

离线

#8 2020-08-04 18:58:16

ascut
会员
注册时间: 2020-08-04
已发帖子: 4
积分: 4

Re: Python + Qt 入坑记录

python 好像有个 PySimpleGUI 挺简单好用点

离线

#9 2020-08-05 20:08:49

演技担当黄晓明
会员
注册时间: 2017-10-17
已发帖子: 184
积分: 122.5

Re: Python + Qt 入坑记录

ERROR: Command errored out with exit status 2:
   command: 'd:\programs\python\python39-32\python.exe' 'd:\programs\python\python39-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\xukaiming\AppData\Local\Temp\pip-build-env-jmcpx2b3\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'sip >=5.3, <7' 'PyQt-builder >=1.1.0, <2'
       cwd: None
  Complete output (59 lines):
  Processing c:\users\xukaiming\appdata\local\pip\cache\wheels\b4\50\c9\930b84257dfd8f8d578b7e6f1325f57ed2457305a48c5c263e\sip-5.3.0-cp39-cp39-win32.whl
  Collecting PyQt-builder<2,>=1.1.0
    Downloading PyQt_builder-1.4.0-py3-none-any.whl (5.5 MB)
  ERROR: Exception:
  Traceback (most recent call last):
    File "d:\programs\python\python39-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 437, in _error_catcher
      yield
    File "d:\programs\python\python39-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
      data = self._fp.read(amt) if not fp_closed else b""
    File "d:\programs\python\python39-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
      data = self.__fp.read(amt)
    File "d:\programs\python\python39-32\lib\http\client.py", line 458, in read
      n = self.readinto(b)
    File "d:\programs\python\python39-32\lib\http\client.py", line 502, in readinto
      n = self.fp.readinto(b)
    File "d:\programs\python\python39-32\lib\socket.py", line 704, in readinto
      return self._sock.recv_into(b)
    File "d:\programs\python\python39-32\lib\ssl.py", line 1241, in recv_into
      return self.read(nbytes, buffer)
    File "d:\programs\python\python39-32\lib\ssl.py", line 1099, in read
      return self._sslobj.read(len, buffer)
  socket.timeout: The read operation timed out

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\cli\base_command.py", line 216, in _main
      status = self.run(options, args)
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
      return func(self, options, args)
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\commands\install.py", line 324, in run
      requirement_set = resolver.resolve(
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
      discovered_reqs.extend(self._resolve_one(requirement_set, req))
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
      abstract_dist = self._get_abstract_dist_for(req_to_install)
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
      abstract_dist = self.preparer.prepare_linked_requirement(req)
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\operations\prepare.py", line 467, in prepare_linked_requirement
      local_file = unpack_url(
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\operations\prepare.py", line 255, in unpack_url
      file = get_http_url(
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\operations\prepare.py", line 129, in get_http_url
      from_path, content_type = _download_http_url(
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\operations\prepare.py", line 282, in _download_http_url
      for chunk in download.chunks:
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\cli\progress_bars.py", line 168, in iter
      for x in it:
    File "d:\programs\python\python39-32\lib\site-packages\pip\_internal\network\utils.py", line 64, in response_chunks
      for chunk in response.raw.stream(
    File "d:\programs\python\python39-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
      data = self.read(amt=amt, decode_content=decode_content)
    File "d:\programs\python\python39-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
      raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
    File "d:\programs\python\python39-32\lib\contextlib.py", line 135, in __exit__
      self.gen.throw(type, value, traceback)
    File "d:\programs\python\python39-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in _error_catcher
      raise ReadTimeoutError(self._pool, None, "Read timed out.")
  pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
  ----------------------------------------
ERROR: Command errored out with exit status 2: 'd:\programs\python\python39-32\python.exe' 'd:\programs\python\python39-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\xukaiming\AppData\Local\Temp\pip-build-env-jmcpx2b3\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'sip >=5.3, <7' 'PyQt-builder >=1.1.0, <2' Check the logs for full command output.

离线

#10 2020-08-05 20:37:28

演技担当黄晓明
会员
注册时间: 2017-10-17
已发帖子: 184
积分: 122.5

Re: Python + Qt 入坑记录

麻烦晕哥帮我看看这个怎么弄

离线

#11 2020-08-05 20:43:03

哇酷小二
管理员
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,387
积分: 1902
个人网站

Re: Python + Qt 入坑记录

演技担当黄晓明 说:

麻烦晕哥帮我看看这个怎么弄

  socket.timeout: The read operation timed out

      raise ReadTimeoutError(self._pool, None, "Read timed out.")
  pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.


貌似连不上服务器?





离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn