Hi
I have a little problem with ~ in my paths.
This code example creates some dirs called "~/some_dir", and do not understand that I wanted to create some_dir in my home dir.
my_dir = "~/some_dir"
if not os.path.exists(my_dir):
os.makedirs(my_dir)
Note this is on a linux based system.
Thanks Johan
Solution:
Thanks all, if I added the line SilentGhost and ddaa suggested it works as you would expect it to.
my_dir = "~/some_dir"
my_dir = os.path.expanduser(my_dir)
if not os.path.exists(my_dir):
os.makedirs(my_dir)