<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on Colin O'Flynn</title><link>https://colinoflynn.com/tag/python/</link><description>Recent content in Python on Colin O'Flynn</description><generator>Hugo</generator><language>en-ca</language><lastBuildDate>Sat, 18 Feb 2023 02:18:24 +0000</lastBuildDate><atom:link href="https://colinoflynn.com/tag/python/index.xml" rel="self" type="application/rss+xml"/><item><title>ESC SV 2015 - USSSSSB: Talking USB From Python</title><link>https://colinoflynn.com/2015/06/esc-sv-2015-usssssb-talking-usb-from-python/</link><pubDate>Tue, 09 Jun 2015 01:51:57 +0000</pubDate><guid>https://colinoflynn.com/2015/06/esc-sv-2015-usssssb-talking-usb-from-python/</guid><description>&lt;p&gt;At ESC 2015 SV I gave a talk on using USB From Python,&lt;a href="http://www.embeddedconf.com/silicon_valley/scheduler/session/usssssb-talking-usb-from-python"&gt; see the talk description here&lt;/a&gt;. This blog post is serving as a placeholder to allow me to update links to software used during the live demo.&lt;/p&gt;
&lt;p&gt;For SuperCon 2015, there is a &lt;a href="https://hackaday.io/project/8251-usssssb-talking-usb-from-python-supercon-2015"&gt;Project Page&lt;/a&gt; with these details too. You can also ask questions on the project page.&lt;br /&gt;
&lt;h3&gt;Download Slides&lt;/h3&gt;&lt;br /&gt;
There is two versions of the slides. Use the SuperCon slides, but I left a copy of the ESC ones here in case you wanted the original for some reason.&lt;/p&gt;</description></item><item><title>QTabWidget in PySide Automatically Resize</title><link>https://colinoflynn.com/2012/11/qtabwidget-in-pyside-automatically-resize/</link><pubDate>Thu, 08 Nov 2012 14:53:00 +0000</pubDate><guid>https://colinoflynn.com/2012/11/qtabwidget-in-pyside-automatically-resize/</guid><description>&lt;p&gt;When using PySide, a QTabWidget is handy. But the size of the QTabWidget is dictated by the largest item, even if it&amp;rsquo;s not visible.
Let&amp;rsquo;s assume self.tw is our tab widget. Then add this function:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;from PySide.QtCore import *
from PySide.QtGui import *

class MainWindow(QMainWindow):
 def curTabChange(self, index):
 for i in range(self.tw.count()):
 if i == index:
 self.tw.widget(i).setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
 else:
 self.tw.widget(i).setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)

 def myOtherFunction(self):
 etc etc etc
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And in your initialization associate it with a tab change event:&lt;/p&gt;</description></item></channel></rss>