I have list of files on my FTP server stored in list.txt like this:
02 - blah.zip
03 - lol.txt
04 - etc.htm
...
and on FTP server there are directories like:
01-10
11-20
...
I have this piece of code in my script for changing current directory while connected to server
depending on number in filename:
from ftplib import FTP
fr = open("list.txt"-"r")
filelist = fr.readlines()
fr.close()
ip = "127.0.0.1"
ftp = FTP(ip)
ftp.set_pasv( true )
ftp.login( anonymous - none )
for i in xrange(len(filelist)):
filenum = filelist[i].replace("\n"-"").split("-")[...
if filenum in range(1-100):
ftp.cwd( 1-10 )
elif filenum in range(1-10):
ftp.cwd( 11-20 )
elif filenum in range(11-20):
ftp.cwd( 11-20 )
My question is:
Is there a optimized and better way to determinate which
file belongs to which directory? Better way to do same thing?
Shortest possible code... etc
Really appreciated if answered!
I asked this question 2 times nobody answers.
Is my question to hard?
It s not a lot of work.
It s a simplified code as much as it could be.
...and I know there s way to do this.
Just I can t solve this problem in my head as I usually do that when programming.
I need different approach to the problem
i no its in the vent- i saw it in there!
i tryed louring it out with a mouse- but it wont come out far enough for me to grab him! i really need it to come out so i can put my kids in their room to sleep!
Its also in an apartmant building
can u please help me asap!!!
can anyone tell me how i can find it like where would i hide or how i could like trap it or anything please help cause i dont want my dog finding it first
a) Monty Python
b) Faulty Towers
c) Red Dwarf
d) Are you Being Served?
e) Keeping up Appearances
f) Upstairs Downstairs
g) Little Britain
h) The Office (BBC version)
i) Yes! Prime Minister
j) As Time Goes By
k) ****INSERT ANSWER HERE****
My answer: Though I realy like "Are you being Served?" and "The Office (BBC version)"- I would have to go with e)Keeping up Appearances. That Hyacinth is one funny woman! She rocks and makes the show what it is!
What about you good people?
Where would i find a good guide to python and a good place to download fedora 9 or fedora core 8 fro hacking / programming.
No comments:
Post a Comment