Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: PySide6 QFontDialog - bug or just me?
Post: PySide6 QFontDialog - bug or just me?

I have a qfontdialog that works ALMOST perfectly BUT I am having one issue. When I first start the program I use self.font = QFont() self.font.setFamily("Sans") self.font.setPointSize(15) (and later...
PatM GUI 1 1,164 Jan-21-2023, 11:22 PM
    Thread: Lint and private var names
Post: Lint and private var names

I've been using _ to start private variables but I've also just found tried out pylint and it complains that the private vars are not snake-case. I don't really care if I use snake-case or _ style my...
PatM General Coding Help 1 730 Dec-14-2022, 12:31 AM
    Thread: First python project
Post: RE: First python project

Another oops, didn't see the code review forum, should have posted this there instead. Sorry
PatM Code Review 2 1,774 Dec-13-2022, 09:32 PM
    Thread: First python project
Post: RE: First python project

Oops, I forgot to say what the program is! It's a button maker. Use any bitmap or SVG button and the program slices that into three parts (you can trim the image). From there you are presented with w...
PatM Code Review 2 1,774 Dec-13-2022, 08:09 PM
    Thread: Qcolor name pyside6
Post: RE: Qcolor name pyside6

Arg, I just couldn't figure it out, to fixated on the QColor error message and completely forgetting my years of windows properties Ugh! Thanks!
PatM General Coding Help 2 1,205 Dec-13-2022, 07:29 AM
    Thread: Qcolor name pyside6
Post: Qcolor name pyside6

I have an error that works if I print but not if I try to use the value. I've tried everything I can think of but can't understand what is going wrong. I get a color from a QColordialog then try to g...
PatM General Coding Help 2 1,205 Dec-13-2022, 03:08 AM
    Thread: First python project
Post: First python project

Ok my first completed Python/PySide6 program. Works fine but I would classify myself as a clumsy wannabe programmer at best so it's pretty ugly. I still have work to do. I am quite absent minded so I ...
PatM Code Review 2 1,774 Dec-13-2022, 12:09 AM
    Thread: Prefs class: singleton or something else?
Post: RE: Prefs class: singleton or something else?

Wow lots to learn! If it works the way I think then @cached_property looks like the closest thing to what I want to achieve. Although the last static singleton is pretty damned close and works perfect...
PatM General Coding Help 7 1,290 Dec-12-2022, 11:01 PM
    Thread: Prefs class: singleton or something else?
Post: RE: Prefs class: singleton or something else?

Yes that worked perfectly, only loaded once despite being called five or six times! Like I said, I started with Python about a month ago so I'm quite ignorant about the language so this was a great he...
PatM General Coding Help 7 1,290 Dec-12-2022, 07:31 PM
    Thread: Prefs class: singleton or something else?
Post: RE: Prefs class: singleton or something else?

I couldn't find anything on static classes when I looked, thanks! (Dec-12-2022, 09:50 AM)Gribouillis Wrote: You could initialize the unique instance in the __new__ static method import time class ...
PatM General Coding Help 7 1,290 Dec-12-2022, 11:16 AM
    Thread: Prefs class: singleton or something else?
Post: RE: Prefs class: singleton or something else?

Here's the singleton preferences class below This is in a .py file by itselfs. I can't load it in one module then use it in all of them because it doesn't exist in any of the other .py files. I could...
PatM General Coding Help 7 1,290 Dec-12-2022, 07:01 AM
    Thread: Prefs class: singleton or something else?
Post: Prefs class: singleton or something else?

I've got a singleton class I'm using that works pretty well but I have several other classes (in different .py files) so I have to create it in every one (Hence the singletopn). Problem is that the pr...
PatM General Coding Help 7 1,290 Dec-12-2022, 04:52 AM
    Thread: newb selfie
Post: RE: newb selfie

I thought there was no way to avoid global variables because of Python scoping? If I write a class for others to use I have no control over how they use variable so from what I can tell I'm stuck writ...
PatM General Coding Help 5 3,706 Feb-18-2019, 08:51 PM
    Thread: newb selfie
Post: newb selfie

I'm trying to get a grasp on Python classes and want to clarify something. If I use a variable name like "count" inside a class and also have a "count" variable outside the class then I *must* use se...
PatM General Coding Help 5 3,706 Feb-18-2019, 08:18 PM
    Thread: smbus contention handling
Post: RE: smbus contention handling

Well it looks like doing it this way isn't a good idea. Hadn't thought of it but "i2c_busy" has the correct value when the thread is created but it doesn't update while the thread is running (makes se...
PatM General Coding Help 1 2,501 Sep-21-2017, 07:13 PM
    Thread: smbus contention handling
Post: smbus contention handling

I have several threads needing to use the Raspberry Pi3 single I2C bus. The threads aren't called all that frequently, the fastest being one per second and the slowest once every 10 minutes. Since the...
PatM General Coding Help 1 2,501 Sep-21-2017, 01:21 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020