I'm new to Python so apologies if this is a basic mistake, I'm trying to write certain information to a txt file (OS is windows).
I want to write "Platform architecture:" as text, and write the output of platform.architecture to a file. Here is my current code:
import.platform
file = open('C:\\Users\\user\\Desktop\\pc info.txt','w')
file.write('Platform architecture:'),platform.architecture
When I hit run a file named pc info is generated on my desktop as expected, but in the file only Platform architecture: is produced as text.
It seems file. write platform.architecture() isn't writing any information to the txt file?
Any ideas please?
withfor file handlingplatform.architecturefunction and that it isn't even inside the parentheses offile.write(...)tells me that you haven't grokked functions yet, and explaining how functions work really isn't what SO is for. It looks to me like you need to spend some time with a programming tutorial.