for BBB in AAA: F = open ("ARTICLES", "a") f.write (BBB) f.close ()
AAA has an array. I want to write the contents of AAA line by line, but with the above program, only the first sentence can be written. How can I improve it?
Answer # 1
Because there is no line break when writing, it's just that it's hard to see because the information is mixed.
Try f.write ('\ n') after outputting BBB as a test.
Or without using a for statement
f.write ('\ n'.join (AAA))
print (* AAA, sep = '\ n', file = f) may be used.
- please tell me how to write fast without using for in python
- python - repeated statement using pyjnius
- i don't understand the exercises using python trigonometric functions
- python: of the results obtained by the for statement, i want to make an empty array like  into [''']
- parameter estimation using python's weighted least squares method (wls)
- parallel processing using python multiprocessingpool and multiprocessingqueue does not work well
- about external libraries when using multiple versions of python
- python - i want to separate by a specific word using the split function
- python - image recognition using cnn keras multiple inputs
- about batch change of file name using python
- python - read and write values from another file
- python 3x - i want to get the nth array with an argument using python3 argparse
- how to make a loop statement in 1 second increments with python
- python for statement conversion how to use the line below
- python 3x - how to rename a folder created using jupyternotebook
- python - about write loop to csv
- python - error in image binarization using cv2adaptivethreshold function
- python 3x - processing to jump to the link destination using chrome driver in python
- swift - how to set the condition of the while statement using dispatchgroup
- python 3x - about functions used in python for statement