In [15]:
connection_to_file_1 = open("draft2.txt", 'w')

In [16]:
connection_to_file_1.write("This is the first draft of a REMARKABLE new bok I am going to write!!")


Out[16]:
69

In [17]:
connection_to_file_1.read()


---------------------------------------------------------------------------
UnsupportedOperation                      Traceback (most recent call last)
<ipython-input-17-7be910ba90f4> in <module>()
----> 1 connection_to_file_1.read()

UnsupportedOperation: not readable

In [8]:
type(connection_to_file_1)


Out[8]:
_io.TextIOWrapper

In [10]:
connection_to_file_2 = open("draft.txt")

# Openning a file cabinet drawer

In [11]:
type(connection_to_file_2)


Out[11]:
_io.TextIOWrapper

In [12]:
print(connection_to_file_2)


<_io.TextIOWrapper name='draft.txt' mode='r' encoding='UTF-8'>

In [14]:
connection_to_file_2.read()


Out[14]:
'This is the first draft of a REMARKABLE new bok I am going to write!!'

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: