How to create a file list of my files included in the same folder? I have posted in this question that I need to put all mye file names from the same folder in one numpy file.
import os
folder = 'C:\\Users\\user\\CPA_test_1000_Tests\\test'
with open('C:\\Users\\user\\My_Test_Traces\\Traces.list_npy', 'w') as fp:
fp.write(os.linesep.join(os.listdir(folder)))
I use this code and it works, but my still with space line between names of files, I mean that the result that I have looks like this:
Trace1_Pltx1
Trace2_Pltx2
Trace3_Pltx3
Trace4_Pltx4
However the result that I must I have, must look like this:
Trace1_Pltx1
Trace2_Pltx2
Trace3_Pltx3
Trace4_Pltx4
I don't know really what is the problem?