I am looking to read and write excel files that are on NFS drive using python. I am using smbclient to open the file The following read operation works.
fileopenmode = 'rb'
with smbclient.open_file(nfsfilepath, mode=fileopenmode) as fd:
contents = pd.read_excel(fd)
I can't find an equivalent write excel that will take a binary value for the file name for example if I try
with smbclient.open_file(nfsfilepath, mode='a') as fd:
with pd.ExcelWriter((fd)) as writer:
texttowrite.to_excel(writer)
I get the following error TypeError: write() argument must be str, not bytes
I tried the above code. I have tried google to and using the doco to find a excel write function that can take bytes as a value for the file name