Python Forum

Full Version: 'function' object has no attribute 'write' paramiko
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello
I want to write in a distant file with sftp.write
my code
write=paramiko.SFTPFile.write
sftp=paramiko.SFTPFile.write
sftp.write(data=hello)
but a error occult
Error:
AttributeError: 'function' object has no attribute 'write'
I have try with the _ but still dosen't work.
thank for the help
Call a function with parenthases.

Quote:
sftp=paramiko.SFTPFile.write
That doesn't write anything, it just creates a reference to the write function, which is almost definitely not what you meant to do.