If i execute below code , i am getting error .
Basically i want to store the contents in a text file , so i am trying to get it in list and write this list in text file . Could anyone help me with this ?
Directory files are printed but unable to store that in list import ftplib
server = ftplib.FTP()
server.connect('host',postnum)
server.login('','')
print("Inside....")
list1=[]
#list1=server.dir()
#print(list1)
stdout = server.dir()
lines = str(stdout.readlines()).split("\n")
print(lines)
Asked
Active
Viewed 12 times
0
GGG
- 35
- 1
- 8