(Aug-06-2020, 04:22 AM)t4keheart Wrote: Of course you can parse the contents of a text file... simplest example:
file1 = open("MyFile.txt","r")
file1.readlines()
file1.close()you can do all sorts of stuff reading and writing to text files.
i know this bro but this only reads your computers files. You can't read a txt from remote server with that.
But i found my own way:
readTxt= transport.open_session()
readTxt.exec_command(cd server;cat example.txt)
data = readTx.recv(1024)But when you try to print data, the output is: 'b' hello world \n or something like that i dont remember.
So you need to decode and strip it.
readTxt= transport.open_session()
readTxt.exec_command(cd server;cat example.txt)
data = readTx.recv(1024)
newData = data.decode().rstrip()And now the output is just "hello world"