Dec-16-2018, 10:48 AM
I am trying to create a Directory (or say, Folder) under the "/tmp/" path.
There, I want to create a Writable Binary file and dump some data. I was doing that in the following way, but neither the Directory nor the File is getting created.
There, I want to create a Writable Binary file and dump some data. I was doing that in the following way, but neither the Directory nor the File is getting created.
... fnamehead,fnametail=os.path.split(name) #'name' contains a arbitrary filepath fname='/tmp/'+fnametail os.makedirs(os.path.dirname(fname)) with open ('xyz','ab') as fd: fd.write(data) ...Please help me with that.