2017-01-01から1年間の記事一覧
skpyを使います 準備 pip install skpy 最近のイベントからグループチャットを検索してメッセージ送信 from skpy import Skype def send(user, password, topic, message): sk = Skype(user, password) for c in sk.chats.recent(): chat = sk.chats[c] if h…
忘れがちなポイント setAcceptDrops(True) 各イベントでevent.accept ファイルパスはTextじゃなくてURL from PySide import QtCore, QtGui import sys, os class DragAndDrop(QtGui.QLabel): def __init__(self): super().__init__() self.setText('Drag and…
import sys from PySide import QtGui app = QtGui.QApplication(sys.argv) icon = None QtGui.QMessageBox.about(icon, 'About', 'Hello.') QtGui.QMessageBox.question(icon, 'Question', 'Are you dead?', QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)…
WIN32から離れられない貴方へ import sys from PySide import QtGui import ctypes class RECT(ctypes.Structure): _fields_ = [('left', ctypes.c_long), ('top', ctypes.c_long), ('right', ctypes.c_long), ('bottom', ctypes.c_long)] class TestWidget(…
QScrollAreaのresizeEventを継承してゴニョゴニョしたら割と簡単にできた import sys from PySide import QtCore, QtGui class AlwaysCenterAlign(QtGui.QScrollArea): def __init__(self): super().__init__() self.setAlignment(QtCore.Qt.AlignCenter) se…
RPIOをインストール モーターは デジタル・マイクロサーボ SG90 を使いました 下記サイトを参考に github.com こんな感じでインストール cd ~ git clone https://github.com/metachris/RPIO.git --branch v2 --single-branch cd RPIO sudo python3.4 setup.p…
メニューやツールバーを実装するときはQPushButtonやコールバックをガリガリ書くのではなくQActionを作る。QActionオブジェクトを作成しておけば、複数のメニューやツールバーをまたいでも、ひとつのQActionオブジェクトで挙動を定義できるし、QActionGroup…
自分の環境でちゃんと動く記事が無かったのでメモ。設定ファイルをあちこち編集するのは好きじゃないのでbash_profileで頑張った。Linuxめんどい。 環境 Raspberry Pi 3 Model B OS 2016-11-25-raspbian-jessie 1. モジュールインストール sudo apt-get inst…