我正在制作游戏,并且已经实现了鼠标,但是当我在某个点单击时,未检测到单击。我做了一个自定义的MouseListener(像一个变量)。可变框架是一个JFrame,我使用方法mousePressed
from pathlib import Path
def find(file_name):
with open(file_name,'r') as f:
text = f.read()
customer = re.findall(r"^CUSTOMER:[\s](.*)\d+", text)
amount = re.findall(r'\((.*?)\)', text)
return customer, amount
file_dir = Path("path_to_directory_containing_files") # CHANGE THIS
all_files = file_dir.glob("*.txt") # this should be whatever pattern that matches all the input files
results = [find(f) for f in all_files]