You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
blog/test/path.py

17 lines
304 B
Python

5 years ago
import os
import tempfile
import shutil
def temppath(*paths):
return os.path.join(tempfile.gettempdir(), *paths)
def move(src, dst):
if os.path.isfile(dst):
os.remove(dst)
elif os.path.isdir(dst):
shutil.rmtree(dst)
if os.path.exists(src):
os.rename(src, dst)