You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lesson Title: Working with Text Files in Python
System: Windows
Software: Komodo Edit 12, Python 3.8.5
Steps:
I am trying to do: Creating and Writing to a Text File
I enter into Komodo:
file-output.py
f = open('helloworld.txt','wb')
f.write('hello world')
f.close()
I save the file as file-output.py
I "Run Python"
Returns the following error:
Traceback (most recent call last):
File "file-output.py", line 3, in
f.write('hello world')
TypeError: a bytes-like object is required, not 'str'
The text was updated successfully, but these errors were encountered:
Lesson Title: Working with Text Files in Python
System: Windows
Software: Komodo Edit 12, Python 3.8.5
Steps:
I am trying to do: Creating and Writing to a Text File
I enter into Komodo:
file-output.py
f = open('helloworld.txt','wb')
f.write('hello world')
f.close()
I save the file as file-output.py
I "Run Python"
Returns the following error:
Traceback (most recent call last):
File "file-output.py", line 3, in
f.write('hello world')
TypeError: a bytes-like object is required, not 'str'
The text was updated successfully, but these errors were encountered: