Testというフォルダがあります'/Desktop/Test/'
フォルダにいくつかのファイルがあります (例: 1.fa,2.fa,3.fa,X.fa)
また'/Desktop/Test/1.fa','/Desktop/Test/2.fa','/Desktop/Test/3.fa','/Desktop/Test/X.fa'
実際に20個ほどの変数を持つ関数を作成せずに、 .fa'/Desktop/Test/'
で終わるディレクトリ内のすべてのファイルを開くために、関数内に要素を作成しようとしています(私がそれを行う方法を知っている唯一の方法です)
例:
def simple(input):
#input would be the directory '/Desktop/Test/'
#for each .fa in the directory (eg. 1.fa, 2.fa, 3.fa, X.fa) i need it to create a list of all the strings within each file
#query=open(input,'r').read().split('\n') is what I would use in my simple codes that only have one input
特定の末尾 (.fa) を持つディレクトリ内のすべてのファイルを入力するにはどうすればよいですか?