Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pathlib import Path
- import os
- dirs_to_match = ['33','28']
- # dirs_to_match = ['foo','bar']
- start_dir = '~/MR_DATA/20180207_ket'
- matches = []
- for root, dirs, files in os.walk(Path(start_dir).expanduser().absolute()):
- for d in dirs:
- if d in dirs_to_match:
- matches.append(Path(root)/d)
- print(matches)
- [PosixPath('/home/virtualfelix/MR_DATA/20180207_ket/28'), PosixPath('/home/virtualfelix/MR_DATA/20180207_ket/33')]
- import convert_bruker_func.py as convert2dseq
- for elements in matches:
- convert2dseq(elements)
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- <ipython-input-58-ea511db08ea6> in <module>()
- ----> 1 import convert_bruker_func.py as convert2dseq
- 2
- 3 for elements in matches:
- 4 convert2dseq(elements)
- ~/MR_DATA/linuxscripts/Python/convert_bruker_func.py in <module>()
- 98
- 99
- --> 100 main()
- TypeError: main() missing 1 required positional argument: 'cwd'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement