is there a way to delete file with issuing the command
import os
os.remove(filename)
Technically, no, unless you write an extension module that issue
the unlink
system call (on POSIX, and the equivalent on others),
which is essentially reimplementing os.remove
or os.unlink
.
In case you just want to directly avoid importing os
,
you can use a library wrapping around it like pathlib.
thanks for your reply