When i try to open a file in write mode with the following code:
packetFile = open("%s/%s/%s/%s.mol2" % ("dir", "dir2", "dir3", "some_file"), "w")
Gives me the following error:
IOError: [Errno 2] No such file or directory: 'dir/dir2/dir3/some_file.mol2'
Note that the "dir/dir2/dir3/" does exist! Also the "w" mode should create the file if it doesn't exist, right?
Cheers,
Ivar