On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran wrote:
>
> On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote:
> > I'm sure I'm missing something obvious here but I can't see an elegant
> > way to do this. I want to create a directory, but if it exists it's
> > not an error and the code should
On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote:
> I'm sure I'm missing something obvious here but I can't see an elegant
> way to do this. I want to create a directory, but if it exists it's
> not an error and the code should just continue.
>
> So, I have:-
>
> for dirname in
On 28Apr2023 10:39, Mats Wichmann wrote:
For this specific case, you can use os.makedirs:
os.makedirs(dirname, exist_ok=True)
I'm not a great fan of makedirs because it will make all the missing
components, not just the final one. So as an example, if you've got a
NAS mounted backup area at
On 28Apr2023 16:55, Chris Green wrote:
for dirname in listofdirs:
try:
os.mkdir(dirname)
except FileExistsError:
# so what can I do here that says 'carry on regardless'
except:
# handle any other error, which is really an error
#
I'm happy to announce a newborn library! foffinf, a way to use
stdlib's logging with the new Format Specification Mini-Language.
In other words, you will be able to do:
logger.info("The result is {:05d}", result)
You can forget about old printf-style formatting now!
To enable which modules
On 4/28/23 11:05, MRAB wrote:
On 2023-04-28 16:55, Chris Green wrote:
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname in
On 2023-04-28 16:55, Chris Green wrote:
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname in listofdirs:
try:
On 4/28/23 09:55, Chris Green wrote:
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname in listofdirs:
try:
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname in listofdirs:
try:
os.mkdir(dirname)
except
I need to develop a Python application that is a sort of gateway between
to networks: a "serial bus" network (think of a serial port or a USB
connection) and a MQTT connection (in my case, it's AWS IoT service).
On the bus, a proprietary protocol is implemented. From the bus, the app
knows
10 matches
Mail list logo