Forum: Poser Python Scripting


Subject: Useful Code Snippets

structure opened this issue on Jun 27, 2019 ยท 94 posts


structure posted Tue, 08 December 2020 at 3:56 PM Forum Coordinator

adp001 posted at 3:55PM Tue, 08 December 2020 - #4406505

Or in short (and without the use of a library):

has_ext = lambda path: path.rfind(".") != -1

hasext("myown/directory/file")
# says: False
hasext("myown/directory/file.txt")
# says: True

this is awesome, I always forget about lambda, thanks.

Locked Out