add card printing data scripts
This commit is contained in:
14
scripts/card_print_data_5.py
Normal file
14
scripts/card_print_data_5.py
Normal 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.")
|
||||
Reference in New Issue
Block a user