Python3 respectively list, numpy arrays, variable content written txt file

Pro-test available

Beginner python, is not very understanding, in fact, just use str () to digital (such as int) can wrap itself does not need to be str type str () digital surround

as follows:

0、file.write(str(12));

1, python numpy save data:

1

numpy.savetxt("result.txt", numpy_data)

2, save list data:

1

2

3

file=open('data.txt','w'

file.write(str(list_data)); 

file.close() 

Guess you like

Origin blog.csdn.net/yimixgg/article/details/90598407