In the Unix shell I can do this to empty a file:
cd /the/file/directory/
:> thefile.ext
How would I go about doing this in Python?
Is os.system
the way here, I wouldn't know how since I would have to send 2 actions after each other i.e. the cd
and then the :>
.