add card printing data scripts

This commit is contained in:
Pritimay Sarkar
2024-01-15 21:00:33 +05:30
parent 14ff954f10
commit 39ec59648c
6 changed files with 230 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import os
import re
file_path = "../../../../Downloads/images/352405884025RAVGMC.jpg"
# Using regular expression to extract the filename without extension
pattern = re.compile(r'/([^/]+)\.[a-z]+$', re.IGNORECASE)
match = pattern.search(file_path)
if match:
extracted_file_name = match.group(1)
print(extracted_file_name)
else:
print("Unable to extract filename from the given path.")