August 2018
Intermediate to advanced
366 pages
10h 14m
English
Perform the following steps for this recipe:
>>> import pathlib
>>>
>>> path = pathlib.Path('somefile.txt')
>>> path.write_text('Hello World') # Write some text into file.
11
>>> print(path.resolve()) # Print absolute path
/Users/amol/wrk/pythonstlcookbook/somefile.txt
>>> path.read_text() # Check the file content
'Hello World'
>>> path.unlink() # Destroy the file
>>> print(path.resolve()) # Print absolute path ...