Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Get current app window handle and bring window to front
Post: Get current app window handle and bring window to ...

I'm trying to set up a simple command line chat application between two computers on my home network. I have the server and client scripts working exactly the way I want except for one little thing. A...
rjdegraff42 Networking 1 1,472 Oct-27-2023, 12:40 AM
    Thread: urllib can't find "parse"
Post: RE: urllib can't find "parse"

Definitely strange behaviour. I tried using the Visual Studio Code IDE and it gives this result >>> dir(urllib) ['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__'...
rjdegraff42 General Coding Help 6 2,376 Jul-24-2023, 05:20 PM
    Thread: urllib can't find "parse"
Post: RE: urllib can't find "parse"

I'm not trying to read a file. I just want to quote/unquote the file strings. I do not understand why it works in idle but not stand-alone. I did find a work-around from urllib import parse print(pa...
rjdegraff42 General Coding Help 6 2,376 Jul-24-2023, 12:19 AM
    Thread: urllib can't find "parse"
Post: urllib can't find "parse"

I don't know if it's just me having a "senior" moment, but when I run the following code in idle import urllib print(urllib.parse.quote('my file.txt'))I get the output my%20file.txtbut when I run t...
rjdegraff42 General Coding Help 6 2,376 Jul-23-2023, 10:26 PM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

Tabled until I learn more about what happens under the hood.
rjdegraff42 General Coding Help 14 2,243 May-03-2023, 01:21 PM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

My initial question, which we seem to have gotten away from, was why the original format was chosen when a more consistent, concise, and clear form is available. So far, nobody has been able to explai...
rjdegraff42 General Coding Help 14 2,243 May-03-2023, 01:40 AM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

The point of making code pretty is to make it more readable. Likewise, making code more concise while maintaining readability is desirable. Two pieces of code can be equivalent (no difference at all ...
rjdegraff42 General Coding Help 14 2,243 May-03-2023, 12:57 AM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

I think the question is what is clearer class A: @getter def foo(self): return 10 @setter def foo(self, value): print('Hello there!')class A: @getter ...
rjdegraff42 General Coding Help 14 2,243 May-02-2023, 08:25 PM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

While I see your point, I don't see how my suggestion breaks anything, although comparing class A: def foo(self): return 10 foo = getter(foo) def foo(self, value): # this era...
rjdegraff42 General Coding Help 14 2,243 May-02-2023, 07:58 PM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

Why do you consider class A: def _foo_getter(self): return 10 def _foo_setter(self, value): print('Hello there!') def _foo_deleter(self): print('Deleting foo')...
rjdegraff42 General Coding Help 14 2,243 May-02-2023, 06:24 PM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

Just because something is legal doesn't make it right. My point was for consistency in syntax. Since getters and setters apply only to properties it would make sense to have @getter and @setter decor...
rjdegraff42 General Coding Help 14 2,243 May-02-2023, 02:23 PM
    Thread: Curious about decorator syntax
Post: RE: Curious about decorator syntax

Now that just makes me cringe. The following: @prop.setter def spam(self, value):should be illegal. Many years ago when I maintained AGC/SCADA code written in FORTRAN I came across the following: IN...
rjdegraff42 General Coding Help 14 2,243 Apr-30-2023, 05:57 PM
    Thread: Feeling pretty discouraged
Post: RE: Feeling pretty discouraged

If I may suggest, I found writing GUI apps in Python particularly fun using wxPython (see wxpython.org). Mike Driscoll has an excellent blog (https://www.blog.pythonlibrary.org/about/) as well as an a...
rjdegraff42 News and Discussions 3 928 Apr-30-2023, 02:14 PM
    Thread: Curious about decorator syntax
Post: Curious about decorator syntax

I'm curious as to the rationale behind the choice of decorator syntax for getters and setters. Take, for example: @property def prop(self): return self._prop @prop.setter ...
rjdegraff42 General Coding Help 14 2,243 Apr-30-2023, 01:58 PM
    Thread: can someone explain this __del__ behaviour?
Post: can someone explain this __del__ behaviour?

I came across something interesting that I can't explain. Perhaps someone here can. When the following code is run with the lambda commented out it produces the output I expect to see. class Exp:...
rjdegraff42 General Coding Help 1 762 Apr-12-2023, 02:37 PM

User Panel Messages

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