python-3.8

PyCharm fails to debug Qt5 (PySide2) code - Error 'Shiboken.ObjectType' object is not iterable

邮差的信 提交于 2019-12-24 07:57:39
问题 I have some experience with Python console applications and now trying to start with Qt for Python (Qt 5.12, PySide2). Actually I'm trying some basic tutorials to understand how it should work. So, I created very simple view.qml : import QtQuick 2.0 import QtQuick.Controls 2.13 ApplicationWindow { visible: true Button { id: button text: qsTr("ClickOnMe") } Connections { target: button onClicked: con.say_hello() } } and have following python code to work with it: from PySide2.QtCore import

How to install PyQt5-tools on Python 3.8 (I can see only wersion for up to 3.7)

不羁岁月 提交于 2019-12-24 07:35:21
问题 I have Python 3.8 on Windows. Already installed via pip PyQt5, tried PyQt5-tools but can't. My PyQt5 version is: 5.13.1 pip install PyQt5-tools gives the error: ERROR: Could not find a version that satisfies the requirement PyQt5-tools(from versions: none) ERROR: No matching distribution found for PyQt5-tools I checked the https://pypi.org/project/pyqt5-tools/#files and tried as they mention to do: pip install pyqt5-tools==5.13.1.1.6rc0 or pip install --pre pyqt5-tools~=5.13.1 gives same

Spyder-IDE fails to start on Windows-10 with Python-3.8

…衆ロ難τιáo~ 提交于 2019-12-10 23:09:13
问题 checking out Python-3.8.0 (x64) on Windows-10, I got into trouble when trying to setup Spyder . Note: the issue was reproducible with a fresh Python installation on a clean Windows-10 system. However, no such issues on Linux (tested on debian/Mint). At first, everything went smooth during installation via pip install spyder . error #1: pywin32 After starting Spyder , it said in the IPython console window: Traceback (most recent call last): File "c:\users\USERNAME\appdata\local\programs\python

Is it possible to add a where clause with list comprehension?

喜夏-厌秋 提交于 2019-12-09 07:48:25
问题 Consider the following list comprehension [ (x,f(x)) for x in iterable if f(x) ] This filters the iterable based a condition f and returns the pairs of x,f(x) . The problem with this approach is f(x) is calculated twice. It would be great if we could write like [ (x,fx) for x in iterable if fx where fx = f(x) ] or [ (x,fx) for x in iterable if fx with f(x) as fx ] But in python we have to write using nested comprehensions to avoid duplicate call to f(x) and it makes the comprehension look

Is it possible to add a where clause with list comprehension?

点点圈 提交于 2019-12-03 09:44:24
Consider the following list comprehension [ (x,f(x)) for x in iterable if f(x) ] This filters the iterable based a condition f and returns the pairs of x,f(x) . The problem with this approach is f(x) is calculated twice. It would be great if we could write like [ (x,fx) for x in iterable if fx where fx = f(x) ] or [ (x,fx) for x in iterable if fx with f(x) as fx ] But in python we have to write using nested comprehensions to avoid duplicate call to f(x) and it makes the comprehension look less clear [ (x,fx) for x,fx in ( (y,f(y) for y in iterable ) if fx ] Is there any other way to make it

“:=” syntax and assignment expressions: what and why?

浪尽此生 提交于 2019-11-27 01:01:07
问题 PEP 572 introduces assignment expressions (colloquially known as the Walrus Operator ), implemented for Python 3.8. This seems like a really substantial new feature since it will allow this form of assignment within comprehensions and lambda functions. What exactly are the syntax, semantics, and grammar specification of assignment expressions? Why is this new (and seemingly quite radical concept) being introduced, when a similar idea in PEP 379 on "Adding an assignment expression" was

Unable to install pygame on Python 3.8 via pip (Windows 10)

做~自己de王妃 提交于 2019-11-26 02:25:37
问题 Currently unable to install pygame via pip. Getting this message: Concerned by it being termed an EOF error, is this an error in the module itself? 回答1: welcome to Stack Overflow Pygame is not compatible with python 3.8 at the moment. I would recommend you to downgrade back to 3.7 and installing with pip there. Let me know how it goes... 回答2: There's dev versions available as of now. Get them via pip install pygame==2.0.0.dev6 回答3: pip is doesn't have pygame up. But there is a alternative