Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Rob Cliffe via Python-list
On 12/11/2024 08:52, Loris Bennett via Python-list wrote: Cameron Simpson writes: Generally you should put a try/except around the smallest possible piece of code. That is excellent advice. Best wishes Rob Cliffe So: config = configparser.ConfigParser() try

sys.call_tracing

2025-01-30 Thread Rob Cliffe via Python-list
call_tracing()| enables explicit recursion of the tracing function. Is there any reason it doesn't support sys.call_tracing(/func/, /args/, kargs) to call func(*args, **kargs) ? Best wishes Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

Re: Dynamic classes

2025-05-19 Thread Rob Cliffe via Python-list
#x27;Flag2': 2, 'Flag3: 4, ' '__init__' : __init__}) This is not my area of expertise, but there is a misplaced quote before     '__init__' that should be after     'Flags3 Correct this, and your example runs without error. Best wishes Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list

Re: Searching for a file

2025-05-24 Thread Rob Cliffe via Python-list
On 25/05/2025 00:18, Mats Wichmann wrote: On 5/23/25 16:05, Rob Cliffe via Python-list wrote: On 23/05/2025 18:55, Mats Wichmann wrote: On 5/22/25 21:04, Rob Cliffe via Python-list wrote: It occurs to me that it might be useful if Python provided a function to search for a file with a

Searching for a file

2025-05-22 Thread Rob Cliffe via Python-list
ing like     C:\Python311\Lib\os.py This idea was partly inspired by Michael Stemper asking about best practice for placing, and finding, a configuration file. Thoughts? Best wishes Rob Cliffe -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Best practice for config files?

2025-05-22 Thread Rob Cliffe via Python-list
isn't).  Alternatively look at the PATH envronment variable, which contains a list of directories separated by semicolons and which you can access as os.environ['PATH'] . Best wishes, Rob Cliffe -- https://mail.python.org/mailman3//lists/python-list.python.org

Re: Searching for a file

2025-05-23 Thread Rob Cliffe via Python-list
On 23/05/2025 18:55, Mats Wichmann wrote: On 5/22/25 21:04, Rob Cliffe via Python-list wrote: It occurs to me that it might be useful if Python provided a function to search for a file with a given name in various directories (much as the import.import_lib function searches for a module in

Re: PEP Idea: Extended import syntax for aliasing module attributes

2025-06-16 Thread Rob Cliffe via Python-list
ill only be imported once). Best wishes, Rob Cliffe -- https://mail.python.org/mailman3//lists/python-list.python.org

<    6   7   8   9   10   11