Sep-27-2022, 12:52 PM
(This post was last modified: Sep-27-2022, 12:52 PM by rob101.
Edit Reason: typo
)
First off: you don't need the semicolon at the end of your code lines.
As for the issue you're having, consider this: simply use the
As for the issue you're having, consider this: simply use the
print()
function with the file
option to 'print' to your log.txt
file. As an example:output = "This is whatever you want it to be" print(output) # goes to sys.stdout by default with open ('log.txt', 'a') as log: print(output, file=log) # the 'file' option is used for the object with a write method
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein