python-2.7

how can I clear a pyqt QTableWidget?

依然范特西╮ 提交于 2020-12-25 01:10:10
问题 I want to clear my QTableWidget. First of all I select a user in a qcombobox after that I click a qpushbutton and I populate it from database records; when I select other user and I click the qpushbutton to add data I try to clear with: self.tableFriends.clear() The data disappears but the rows remain. The code I populate with is: def getFriends(self): id_us = self.cbUser.itemData(self.cbUser.currentIndex()).toPyObject() rowIndex = 0 self.tableFriends.clear() for row in self.SELECT_FRIENDS(id

how can I clear a pyqt QTableWidget?

痴心易碎 提交于 2020-12-25 01:04:17
问题 I want to clear my QTableWidget. First of all I select a user in a qcombobox after that I click a qpushbutton and I populate it from database records; when I select other user and I click the qpushbutton to add data I try to clear with: self.tableFriends.clear() The data disappears but the rows remain. The code I populate with is: def getFriends(self): id_us = self.cbUser.itemData(self.cbUser.currentIndex()).toPyObject() rowIndex = 0 self.tableFriends.clear() for row in self.SELECT_FRIENDS(id

Is it possible to include csv file as part of python package [duplicate]

与世无争的帅哥 提交于 2020-12-24 17:40:33
问题 This question already has answers here : How to include package data with setuptools/distutils? (13 answers) Closed 4 years ago . Is it possible to include a csv file as part of python package? I am creating a package and want some default config files which are imported at runtime. I know I can store as a list or other structure in a .py file, but this will break the pattern I'm building against. 回答1: This can be done in a two-step process, as detailed here. You need one file in the root of

Pyo server.boot() fails with pyolib._core.PyoServerStateException on Ubuntu 14.04

本小妞迷上赌 提交于 2020-12-23 04:07:32
问题 I installed pyo on Ubuntu 14.04 without jack and running Python 2.7.I followed the Debian-based installing instructions written in pyo wiki. This was the code i used (it's in the pyo introduction page): from pyo import * s = Server().boot() s.start() a = Sine(mul=0.01).out() And got as result: pyo version 0.6.8 (uses single precision) ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2239:(snd

Pyo server.boot() fails with pyolib._core.PyoServerStateException on Ubuntu 14.04

老子叫甜甜 提交于 2020-12-23 04:04:58
问题 I installed pyo on Ubuntu 14.04 without jack and running Python 2.7.I followed the Debian-based installing instructions written in pyo wiki. This was the code i used (it's in the pyo introduction page): from pyo import * s = Server().boot() s.start() a = Sine(mul=0.01).out() And got as result: pyo version 0.6.8 (uses single precision) ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2239:(snd

Pyo server.boot() fails with pyolib._core.PyoServerStateException on Ubuntu 14.04

佐手、 提交于 2020-12-23 04:02:32
问题 I installed pyo on Ubuntu 14.04 without jack and running Python 2.7.I followed the Debian-based installing instructions written in pyo wiki. This was the code i used (it's in the pyo introduction page): from pyo import * s = Server().boot() s.start() a = Sine(mul=0.01).out() And got as result: pyo version 0.6.8 (uses single precision) ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2239:(snd

Cannot use Python's pip on Windows 8. “specified executable is not a valid application for this os platform”

前提是你 提交于 2020-12-16 04:40:18
问题 I seem to be receiving a unique error in Python 2.7.6 on Windows 8 64bit. I was able to install Python perfectly, then was able to install pip using this guide. But when I got to step 3 and I tried to install virtualenv using pip it gave me this error: Program 'pip.exe' failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1 + pip.exe install virtualenv + ~~~~~~~~~~~~~~~~~~~~~~~~~~. At line:1 char:1 + pip.exe install virtualenv + ~~~~~~~~~~~~~~

“Blinking” buttons in PyQT5

蹲街弑〆低调 提交于 2020-12-15 10:24:36
问题 Here's the deal: I'm trying to make button A "blink" when button B is pushed, and the blinking should then stop when the user pushes button A. Furthermore, button A should then go back to its former state. After long reading through the documentation and other questions at SO, I have now following piece of code: Python 2.7 class Widget(QWidget): def __init__(self): super(Widget, self).__init__() self.resize(300,200) layout = QVBoxLayout(self) self.button_stop = QPushButton("Stop") layout

“Blinking” buttons in PyQT5

我怕爱的太早我们不能终老 提交于 2020-12-15 10:20:56
问题 Here's the deal: I'm trying to make button A "blink" when button B is pushed, and the blinking should then stop when the user pushes button A. Furthermore, button A should then go back to its former state. After long reading through the documentation and other questions at SO, I have now following piece of code: Python 2.7 class Widget(QWidget): def __init__(self): super(Widget, self).__init__() self.resize(300,200) layout = QVBoxLayout(self) self.button_stop = QPushButton("Stop") layout

Inserting comments in presentation using Python

大兔子大兔子 提交于 2020-12-13 11:58:07
问题 I want to add some comments in presentation file for some text-boxes. Is there any python-pptx attribute available to do that ? 回答1: PowerPoint comments are not yet supported in python-pptx . There's not really a feature request for that at the time of this writing, so you can feel free to add one if you like. 回答2: Recommended reading : https://python-pptx.readthedocs.io/en/latest/user/text.html https://python-pptx.readthedocs.io/en/latest/user/quickstart.html Hope this helps, 来源: https:/