Let's take this:
f = open ('myflie.txt', 'w')
f.write ('12345');
I always get the length of the output printed on the console.
Is there any way to prevent it from printing it?
There must be something else in your program. In principle, these 2 lines don't send anything to the console.
You are using the Python shell.
>>> f = open ('myflie.txt', 'w')
>>> f.write ('12345')
5
The Python shell is for testing of short code ideas. Use the editor to write programs.
You are using the Python shell.
>>> f = open ('myflie.txt', 'w') >>> f.write ('12345') 5
The Python shell is for testing of short code ideas. Use the editor to write programs.
Well that solved the problem. ;)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.