Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Get return value from a threaded function
Post: RE: Get return value from a threaded function

If that is the case then how do you explain that the line "files = thread.get()" gets me the value that is returned by the threaded function?
Reverend_Jim General Coding Help 3 17,035 Mar-12-2021, 03:44 AM
    Thread: Get return value from a threaded function
Post: RE: Get return value from a threaded function

With a little more effort I found the solution although it didn't involve adding to my existing code. The full solution is below import os import fnmatch from multiprocessing.pool import ThreadPool...
Reverend_Jim General Coding Help 3 17,035 Mar-11-2021, 10:53 PM
    Thread: Get return value from a threaded function
Post: Get return value from a threaded function

I have the following function that builds a file list. import os import fnmatch import threading def getFiles(root='.', pattern='*.*', recurse=False): results = [] i...
Reverend_Jim General Coding Help 3 17,035 Mar-11-2021, 05:04 PM
    Thread: Walrus Operator in 3.8
Post: RE: Walrus Operator in 3.8

was rejected because it isn't visually different enough from an equality check (==) I realize this is not going to happen but that statement is justification for using the walrus operator everywhere ...
Reverend_Jim News and Discussions 21 9,803 Jul-20-2019, 04:15 PM
    Thread: Walrus Operator in 3.8
Post: RE: Walrus Operator in 3.8

Algol and Algol68 both used the walrus operator for assignment to avoid the ambiguity between assignment and equality testing. Personally I find Python's use of == for equality testing ugly and would ...
Reverend_Jim News and Discussions 21 9,803 Jul-19-2019, 01:04 PM
    Thread: Trying to get a coherent python installation
Post: RE: Trying to get a coherent python installation

It works better now. Fortunately I take an image of my system (C:) partition every morning so I dropped back to an image from before I tried to "fix" things. Rather than uninstall Python36 I just left...
Reverend_Jim General Coding Help 2 3,834 Jun-19-2019, 09:56 PM
    Thread: Trying to get a coherent python installation
Post: Trying to get a coherent python installation

I'm finding it difficult to get a consistent/coherent python installation. I had originally installed a 3.6 version of python from python.org (Windows 10 laptop). This installed to (the default locati...
Reverend_Jim General Coding Help 2 3,834 Jun-18-2019, 06:54 PM
    Thread: Version of glob for that Supports Windows Wildcards?
Post: RE: Version of glob for that Supports Windows Wild...

Yeah. Tried that. Unfortunately, glob.escape also escapes "*" which means I can no longer use Windows/DOS wildcards in my file names.
Reverend_Jim General Coding Help 5 5,648 Jun-18-2019, 06:31 PM
    Thread: Version of glob for that Supports Windows Wildcards?
Post: RE: Version of glob for that Supports Windows Wild...

As it turns out pattern.replace("[", "[[").replace("]", "]]")doesn't work, however pattern.replace("[", "[[]")does the trick. Thanks for the suggestion. Silly? Yes. Inelegant? Also yes, but it's short...
Reverend_Jim General Coding Help 5 5,648 Jun-15-2019, 03:36 PM
    Thread: Version of glob for that Supports Windows Wildcards?
Post: Version of glob for that Supports Windows Wildcard...

Is there a Python module that works like glob except that it works properly on Windows? Here's the problem. Windows recognizes "?" and "*" as wildcards. Windows does NOT recognize "[" or "]" as speci...
Reverend_Jim General Coding Help 5 5,648 Jun-14-2019, 10:37 PM
    Thread: Problem with importing an installed package
Post: RE: Problem with importing an installed package

I don't see how I could be any clearer. Until I did the mod to Python.File my example wouldn't work when run as D:\>pymsgtest but it would work when I did D:\>python and then typed t...
Reverend_Jim General Coding Help 4 3,702 Jun-14-2019, 10:20 PM
    Thread: Problem with importing an installed package
Post: RE: Problem with importing an installed package

I don't understand what you are saying. When I run other python scripts from a cmd shell via Windows file association they work fine. The one that imports pymsgbox does not. Got a solution. When I ra...
Reverend_Jim General Coding Help 4 3,702 Jun-09-2019, 08:22 PM
    Thread: Problem with importing an installed package
Post: Problem with importing an installed package

I installed pymsgbox using pip. I created a sample file that does only import pymsgbox pymsgbox.alert("some text")When I run it from the command line (like most of my scripts) by typing "sample" I ju...
Reverend_Jim General Coding Help 4 3,702 Jun-09-2019, 06:18 PM

User Panel Messages

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