-
Notifications
You must be signed in to change notification settings - Fork 0
/
datafiles_opener.py
49 lines (32 loc) · 1.09 KB
/
datafiles_opener.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: lj21342
#
# Created: 17/03/2022
# Copyright: (c) lj21342 2022
# Licence: <your licence>
#-------------------------------------------------------------------------------
import os, glob
def open_files(full_path=os.getcwd(), _filter="txt"):
_filter = '*.' + _filter
print('Looking for the directory:\t', full_path)
if not os.path.exists(full_path):
print(f'no dir {dir}')
else:
filelist = [] # list of raw files to process
os.chdir(full_path)
print('Scanning for data files in:\t', full_path)
for file in glob.glob(_filter):
filelist.append(file[:-4]) # add txt files to the list
print('The following files will be processed:')
for file in filelist:
print(file)
return filelist
#def read_data(files, mode='multiple'):
#if mode == 'multiple':
def main():
pass
if __name__ == '__main__':
main()