Print Python results to new text

Asked 2 years ago, Updated 2 years ago, 18 views

For example, if the Python output reads ["Company Name", "Name", "Address", "Phone Number", "Fax", how do I enter it in a new text file?

python

2022-09-30 19:09

1 Answers

Depending on how you use it, you may just need to redirect it.
At the console/command prompt,

 python program.py> output file.txt

and so on, and so on, the contents of the console output, such as print, are written directly to the file.


2022-09-30 19:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.