I have a file ("public_html/try.dat") in my domain. I would like to read the first line of the file, without writing it out to disk.
import ftplib
string = ''
session = ftplib.FTP('xxx.com.au','user',"password")
session.storlines('RETR public_html/try.dat', string)
print (string)
session.quit()
The code above gives me an error on the 4th line: AttributeError: 'str' object has no attribute 'readline'
* A word of explanation *
I would like to send/receive a string between two different remote computers on the internet. Unfortunately my (cable) modem does not allow port forwarding, so I am forced to find another way, and the above is the only easy way I could think of. Stupid I know...