Skip to content

Instantly share code, notes, and snippets.

python: stdout/stderr (?): Traceback (most recent call last):
python: stdout/stderr (?): File "/home/anddam/.weechat/python/autoload/otr.py", line 44, in <module>
python: stdout/stderr (?): import potr
python: stdout/stderr (?): ModuleNotFoundError: No module named 'potr'
python: unable to parse file "/home/anddam/.weechat/python/autoload/otr.py"
python scripts loaded: autojoin, autosort, grep
We can't make this file beautiful and searchable because it's too large.
Date,Open,High,Low,Close,Adj Close,Volume
1971-02-05,100.000000,100.000000,100.000000,100.000000,100.000000,0
1971-02-08,100.839996,100.839996,100.839996,100.839996,100.839996,0
1971-02-09,100.760002,100.760002,100.760002,100.760002,100.760002,0
1971-02-10,100.690002,100.690002,100.690002,100.690002,100.690002,0
1971-02-11,101.449997,101.449997,101.449997,101.449997,101.449997,0
1971-02-12,102.050003,102.050003,102.050003,102.050003,102.050003,0
1971-02-16,102.190002,102.190002,102.190002,102.190002,102.190002,0
1971-02-17,101.739998,101.739998,101.739998,101.739998,101.739998,0
1971-02-18,101.419998,101.419998,101.419998,101.419998,101.419998,0
python3-3.9.4_1: configuring ...
Byte-compiling python code in usr/lib/python3.9...
./usr/lib/python3.9/site-packages/wx/lib/masked/maskededit.py:2648: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
ve = ValueError('"%s" will not fit into field %d of control "%s"' (choice, index, self.name))
./usr/lib/python3.9/site-packages/wx/lib/plot/plotcanvas.py:1855: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if self._xSpec is not 'none':
./usr/lib/python3.9/site-packages/wx/lib/plot/plotcanvas.py:1860: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if self._ySpec is not 'none':
./usr/lib/python3.9/site-packages/wx/lib/masked/maskededit.py:2648: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
ve = ValueError('"%s" will not fit into field %d of control "%s"' (choice, index, self.name))
@anddam
anddam / dmesg output
Last active April 13, 2021 13:39
Pulseaudio issue recognizing an USB Trust headset
[ 562.620236] virbr0: port 1(vnet0) entered disabled state
[ 562.694045] usb 1-1.5: reset full-speed USB device number 8 using xhci_hcd
[ 562.837379] usb 1-1.6: reset full-speed USB device number 9 using xhci_hcd
[ 619.286409] usb 1-1.1: USB disconnect, device number 13
[ 621.505856] usb 1-1.1: new full-speed USB device number 14 using xhci_hcd
[ 621.586984] usb 1-1.1: New USB device found, idVendor=145f, idProduct=02d2, bcdDevice= 1.00
[ 621.586999] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 621.587007] usb 1-1.1: Product: Trust On-ear USB PC Headset
[ 621.587013] usb 1-1.1: Manufacturer: Generalplus
[ 621.603118] input: Generalplus Trust On-ear USB PC Headset as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.1/1-1.1:1.3/0003:145F:02D2.0007/input/input27
@anddam
anddam / main.py
Created March 5, 2021 00:41
QListWidget custom widget in item
"""Try to use a custom widget in a QListWidgetItem, expected result is test-row.ui widget in each row.
Actual result is blank lines.
Require PySide2, tested on Python 3.8.6
"""
import sys
from PySide2.QtWidgets import (
QApplication,
QHBoxLayout,
Traceback (most recent call last):
File "\\myserver\cm\gui\main_window.py", line 147, in on_reader_list_selection_changed
(self.tr("Serial number"), self.tr(serialNumber)),
ValueError: 'PySide2.QtCore.QObject.tr' called with wrong argument values:
PySide2.QtCore.QObject.tr(b'2444136000017023',)
Found signature:
PySide2.QtCore.QObject.tr(bytes, bytes = b'', int = -1)
(foo) anddam@metis:/tmp/tmppy$ time pip install PySide2
Collecting PySide2
Using cached PySide2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-manylinux1_x86_64.whl (164.3 MB)
Collecting shiboken2==5.15.2
Using cached shiboken2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-abi3-manylinux1_x86_64.whl (956 kB)
Installing collected packages: shiboken2, PySide2
Successfully installed PySide2-5.15.2 shiboken2-5.15.2
WARNING: You are using pip version 20.2.1; however, version 21.0.1 is available.
You should consider upgrading via the '/tmp/tmppy/foo/bin/python -m pip install --upgrade pip' command.
signal time=1611526615.877833 sender=:1.63 -> destination=(null destination) serial=10 path=/org/gtk/Private/RemoteVolumeMonitor; interface=org.gtk.Private.RemoteVolumeMonitor; member=VolumeAdded
string "org.gtk.vfs.MTPVolumeMonitor"
string "0x558396838000"
struct {
string "0x558396838000"
string "Pixel 4a"
string "phone"
string ". GThemedIcon phone-symbolic phone"
if not (
self.pin_locked
and self.user_pin_count_low
and self.user_pin_final_try
and self.user_pin_locked
):
def Proxy:
"""Pass over a callback but get ahold of it
"""
def __init__(self, callback=None):
def augmented_call(*args, **kwargs):
self.callback_notification()
return callback(*args, **kwargs) if callback else None
self.someInstance = SomeClass(callback=augmented_call)