import subprocess
import glob
import pathlib
def findOpen(url, fil):
share = pathlib.WindowsPath(url)
try:
if share.exists():
path = ''
print(url)
for x in share.glob(fil):
print(x)
path = str(x)
if path != '':
print('Open : ' + path)
subprocess.Popen(['start','', path], shell=True)
except:
import traceback
traceback.print_exc()
input("Press Enter to continue...")
url = r'C:\\フォルダ'
fil = '[!(~$)]*ファイル名.xls?'
findOpen(url,fil)
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
10