Trying to split the directories gave me the same error message with the previous one?
Alper
Alper
----- Original Message ----
From: [EMAIL PROTECTED]
To: python-list@python.org
Sent: Thursday, August 31, 2006 4:40:03 PM
Subject: Python-list Digest, Vol 35, Issue 501
From: [EMAIL PROTECTED]
To: python-list@python.org
Sent: Thursday, August 31, 2006 4:40:03 PM
Subject: Python-list Digest, Vol 35, Issue 501
Send Python-list mailing list submissions to
python-list@python.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Python-list digest..."
python-list@python.org
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/python-list
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Python-list digest..."
Today's Topics:
1. Tkinter listbox question ([EMAIL PROTECTED])
2. Re: Using eval with substitutions (Peter Otten)
3. Re: a question about my script (alper soyler)
4. Re: a question about my script (Fredrik Lundh)
5. Re: Using eval with substitutions (Duncan Booth)
6. Re: a question about my script (alper soyler)
7. simultaneous copy to multiple media ([EMAIL PROTECTED])
1. Tkinter listbox question ([EMAIL PROTECTED])
2. Re: Using eval with substitutions (Peter Otten)
3. Re: a question about my script (alper soyler)
4. Re: a question about my script (Fredrik Lundh)
5. Re: Using eval with substitutions (Duncan Booth)
6. Re: a question about my script (alper soyler)
7. simultaneous copy to multiple media ([EMAIL PROTECTED])
From: [EMAIL PROTECTED]
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
Date: 31 Aug 2006 05:41:43 -0700
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
Subject: Tkinter listbox question
Message: 1
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
Date: 31 Aug 2006 05:41:43 -0700
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
Subject: Tkinter listbox question
Message: 1
Hi,
I need help about Tkinter listbox widget.I want,when somebody click on
any item(file) in Listbox,then in new Label widget text must be
selected item from server.
my program (wrong example):
import ftputil
import Tkinter
root=Tkinter.Tk()
ftp=ftputil.FTPHost('some imaginary server')
def LabelWidget(event):
a=Tkinter.Label(root,text=) # Text must be only name and file
format,example: sun.gif
a.grid()
b=Tkinter.Listbox(root)
b.insert(Tkinter.END,ftp._dir(''))
b.place()
c=Tkinter.Button(root,text='PRINT THIS FILE IN NEW LABEL WIDGET')
c.bind('<Button-1>',LabelWidget)
c.grid()
root.mainloop()
THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I need help about Tkinter listbox widget.I want,when somebody click on
any item(file) in Listbox,then in new Label widget text must be
selected item from server.
my program (wrong example):
import ftputil
import Tkinter
root=Tkinter.Tk()
ftp=ftputil.FTPHost('some imaginary server')
def LabelWidget(event):
a=Tkinter.Label(root,text=) # Text must be only name and file
format,example: sun.gif
a.grid()
b=Tkinter.Listbox(root)
b.insert(Tkinter.END,ftp._dir(''))
b.place()
c=Tkinter.Button(root,text='PRINT THIS FILE IN NEW LABEL WIDGET')
c.bind('<Button-1>',LabelWidget)
c.grid()
root.mainloop()
THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Content-Transfer-Encoding: 7Bit
From: Peter Otten <[EMAIL PROTECTED]>
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Date: Thu, 31 Aug 2006 14:54:50 +0200
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii
Subject: Re: Using eval with substitutions
Message: 2
From: Peter Otten <[EMAIL PROTECTED]>
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Date: Thu, 31 Aug 2006 14:54:50 +0200
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii
Subject: Re: Using eval with substitutions
Message: 2
[EMAIL PROTECTED] wrote:
> Fredrik Lundh wrote:
>> (I'm afraid I don't really understand the point of your examples; what
>> is it you're really trying to do here ?)
>
> A function is passed a bunch of string expressions like,
> x = "a+b"
> y= "x*a"
> z= "x+y"
>
> where a and b are assumed to have been assigned values in the local
> namespace. Now I have to evaluate another string such as,
> "z+y+x"
>
> So as you say, I could do:
> x=eval(x), y=eval(y), z=eval(z) and finally eval("z+y+x") but the
> problem is that the initial strings are in no particular order, so I
> don't know the sequence in which to perform the first 3 evaluations. I
> was wondering if there was a simple way to 'pattern-match' so that the
> required substitutions like z->x+y->x+x*a->(a+b)+(a+b)*a could be done
> automatically.
Here is something to start with:
class EvalDict(object):
def __init__(self, namespace):
self.namespace = namespace
def __getitem__(self, key):
value = self.namespace[key]
if isinstance(value, str):
self.namespace[key] = value = eval(value, {}, self)
return value
def smart_eval(expr, namespace):
return eval(expr, {}, EvalDict(namespace))
def f():
a = 2
b = 3
x = "a+b"
y = "x*a"
z = "x+y"
return smart_eval("x + y + z", locals())
if __name__ == "__main__":
print f()
Beware of infinite recursion:
# RuntimeError: maximum recursion depth exceeded
smart_eval("a + b", dict(a="b", b="a"))
Peter
> Fredrik Lundh wrote:
>> (I'm afraid I don't really understand the point of your examples; what
>> is it you're really trying to do here ?)
>
> A function is passed a bunch of string expressions like,
> x = "a+b"
> y= "x*a"
> z= "x+y"
>
> where a and b are assumed to have been assigned values in the local
> namespace. Now I have to evaluate another string such as,
> "z+y+x"
>
> So as you say, I could do:
> x=eval(x), y=eval(y), z=eval(z) and finally eval("z+y+x") but the
> problem is that the initial strings are in no particular order, so I
> don't know the sequence in which to perform the first 3 evaluations. I
> was wondering if there was a simple way to 'pattern-match' so that the
> required substitutions like z->x+y->x+x*a->(a+b)+(a+b)*a could be done
> automatically.
Here is something to start with:
class EvalDict(object):
def __init__(self, namespace):
self.namespace = namespace
def __getitem__(self, key):
value = self.namespace[key]
if isinstance(value, str):
self.namespace[key] = value = eval(value, {}, self)
return value
def smart_eval(expr, namespace):
return eval(expr, {}, EvalDict(namespace))
def f():
a = 2
b = 3
x = "a+b"
y = "x*a"
z = "x+y"
return smart_eval("x + y + z", locals())
if __name__ == "__main__":
print f()
Beware of infinite recursion:
# RuntimeError: maximum recursion depth exceeded
smart_eval("a + b", dict(a="b", b="a"))
Peter
From: alper soyler <[EMAIL PROTECTED]>
Precedence: list
MIME-Version: 1.0
To: Python-list@python.org
In-Reply-To: <[EMAIL PROTECTED]>
Date: Thu, 31 Aug 2006 06:01:09 -0700 (PDT)
Reply-To: alper soyler <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: multipart/alternative; boundary="0-620705374-1157029269=:50849"
Subject: Re: a question about my script
Message: 3
Precedence: list
MIME-Version: 1.0
To: Python-list@python.org
In-Reply-To: <[EMAIL PROTECTED]>
Date: Thu, 31 Aug 2006 06:01:09 -0700 (PDT)
Reply-To: alper soyler <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: multipart/alternative; boundary="0-620705374-1157029269=:50849"
Subject: Re: a question about my script
Message: 3
Hi,
I changed the script as you wrote below:
from ftplib import FTP
def handleDownload(block):
file.write(block)
print ".",
ftp = FTP('ftp.genome.jp')
print ftp.login()
directory = 'pub/kegg/genomes'
ftp.cwd(directory)
k=0
for direct in ftp.nlst():
curdir = '%s/%s' % (directory, direct)
ftp.cwd(curdir)
for filename in ftp.nlst():
if not filename.endswith('.pep'): continue
file = open(filename, 'wb')
ftp.retrbinary('RETR %s/%s' % (curdir, filename), handleDownload)
file.close()
k=k+1
print ftp.close()
However, it gave the same error message:
230 Anonymous access granted, restrictions apply.
Traceback (most recent call last):
File "ftp1.0.py", line 18, in ?
ftp.cwd(curdir)
File "/usr/lib/python2.4/ftplib.py", line 494, in cwd
return self.voidcmd(cmd)
File "/usr/lib/python2.4/ftplib.py", line 246, in voidcmd
return self.voidresp()
File "/usr/lib/python2.4/ftplib.py", line 221, in voidresp
resp = self.getresp()
File "/usr/lib/python2.4/ftplib.py", line 216, in getresp
raise error_perm, resp
ftplib.error_perm: 550 pub/kegg/genomes/aae: No such file or directory
However, in ftp.genome.jp/pub/kegg/genomes/ site, there is 'aae' directory. What can be the reason?
regards,
alper
I changed the script as you wrote below:
from ftplib import FTP
def handleDownload(block):
file.write(block)
print ".",
ftp = FTP('ftp.genome.jp')
print ftp.login()
directory = 'pub/kegg/genomes'
ftp.cwd(directory)
k=0
for direct in ftp.nlst():
curdir = '%s/%s' % (directory, direct)
ftp.cwd(curdir)
for filename in ftp.nlst():
if not filename.endswith('.pep'): continue
file = open(filename, 'wb')
ftp.retrbinary('RETR %s/%s' % (curdir, filename), handleDownload)
file.close()
k=k+1
print ftp.close()
However, it gave the same error message:
230 Anonymous access granted, restrictions apply.
Traceback (most recent call last):
File "ftp1.0.py", line 18, in ?
ftp.cwd(curdir)
File "/usr/lib/python2.4/ftplib.py", line 494, in cwd
return self.voidcmd(cmd)
File "/usr/lib/python2.4/ftplib.py", line 246, in voidcmd
return self.voidresp()
File "/usr/lib/python2.4/ftplib.py", line 221, in voidresp
resp = self.getresp()
File "/usr/lib/python2.4/ftplib.py", line 216, in getresp
raise error_perm, resp
ftplib.error_perm: 550 pub/kegg/genomes/aae: No such file or directory
However, in ftp.genome.jp/pub/kegg/genomes/ site, there is 'aae' directory. What can be the reason?
regards,
alper
----- Original Message ----
From: Gabriel Genellina <[EMAIL PROTECTED]>
To: alper soyler <[EMAIL PROTECTED]>
Cc: Python-list@python.org
Sent: Tuesday, August 29, 2006 10:26:57 AM
Subject: Re: a question about my script
From: Gabriel Genellina <[EMAIL PROTECTED]>
To: alper soyler <[EMAIL PROTECTED]>
Cc: Python-list@python.org
Sent: Tuesday, August 29, 2006 10:26:57 AM
Subject: Re: a question about my script
At Tuesday 29/8/2006 03:55, alper soyler wrote:
>I am trying to get some files from an ftp site by ftplib module and
>I wrote the below script. However I have a problem. With my script,
>I login to ftp.genome.jp site. then, I am changing the directory to
>pub/kegg/genomes/afm and I am downloading "a.fumigatus.pep" file.
>However, what I want is to connect pub/kegg/genomes directory and in
>this directory there are 3 letters name files
3 letters *files*? or 3 letters *directories*?
>e.g. 'afm' and in each of these 3 letters files there is a file with
>the extension of '.pep' like a.fumigatus.pep. I want to get these
>'.pep' files from the 3 letter named files. If you help me I will be
>very glad. Thanks you in advance.
Do a cwd() starting one level above (that is, pub/kegg/genomes);
using ftp.dir() you can get the subdirectories, then iterate over all
of them, using another dir() to find the .pep files needed.
>directory = 'pub/kegg/genomes/ afm'
Is that whitespace intentional?
(If you just want to download the files and don't need really a
Python script, try wget...)
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
>I am trying to get some files from an ftp site by ftplib module and
>I wrote the below script. However I have a problem. With my script,
>I login to ftp.genome.jp site. then, I am changing the directory to
>pub/kegg/genomes/afm and I am downloading "a.fumigatus.pep" file.
>However, what I want is to connect pub/kegg/genomes directory and in
>this directory there are 3 letters name files
3 letters *files*? or 3 letters *directories*?
>e.g. 'afm' and in each of these 3 letters files there is a file with
>the extension of '.pep' like a.fumigatus.pep. I want to get these
>'.pep' files from the 3 letter named files. If you help me I will be
>very glad. Thanks you in advance.
Do a cwd() starting one level above (that is, pub/kegg/genomes);
using ftp.dir() you can get the subdirectories, then iterate over all
of them, using another dir() to find the .pep files needed.
>directory = 'pub/kegg/genomes/ afm'
Is that whitespace intentional?
(If you just want to download the files and don't need really a
Python script, try wget...)
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
From: "Fredrik Lundh" <[EMAIL PROTECTED]>
Precedence: list
To: python-list@python.org
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Date: Thu, 31 Aug 2006 15:12:42 +0200
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: a question about my script
Message: 4
Precedence: list
To: python-list@python.org
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Date: Thu, 31 Aug 2006 15:12:42 +0200
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: a question about my script
Message: 4
"alper soyler" wrote:
> directory = 'pub/kegg/genomes'
> ftp.cwd(directory)
> ftplib.error_perm: 550 pub/kegg/genomes/aae: No such file or directory
> However, in ftp.genome.jp/pub/kegg/genomes/ site, there is 'aae' directory.
> What can be the reason?
try doing the cwd in pieces:
for d in directory.split("/"):
ftp.cwd(d)
</F>
> directory = 'pub/kegg/genomes'
> ftp.cwd(directory)
> ftplib.error_perm: 550 pub/kegg/genomes/aae: No such file or directory
> However, in ftp.genome.jp/pub/kegg/genomes/ site, there is 'aae' directory.
> What can be the reason?
try doing the cwd in pieces:
for d in directory.split("/"):
ftp.cwd(d)
</F>
Content-Transfer-Encoding: 8bit
From: Duncan Booth <[EMAIL PROTECTED]>
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Date: 31 Aug 2006 13:13:41 GMT
Reply-To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=iso-8859-1
Subject: Re: Using eval with substitutions
Message: 5
From: Duncan Booth <[EMAIL PROTECTED]>
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
Date: 31 Aug 2006 13:13:41 GMT
Reply-To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=iso-8859-1
Subject: Re: Using eval with substitutions
Message: 5
[EMAIL PROTECTED] wrote:
> So as you say, I could do:
> x=eval(x), y=eval(y), z=eval(z) and finally eval("z+y+x") but the
> problem is that the initial strings are in no particular order, so I
> don't know the sequence in which to perform the first 3 evaluations. I
> was wondering if there was a simple way to 'pattern-match' so that the
> required substitutions like z->x+y->x+x*a->(a+b)+(a+b)*a could be done
> automatically.
>
Sounds a bit of an odd thing to do, but:
>>> def evaluate(var, names):
expr = names[var]
names['__builtins__'] = {}
if isinstance(expr, basestring):
del names[var]
code = compile(expr, "<%s>"%var, "eval")
for v in code.co_names:
evaluate(v, names)
names[var] = eval(code, names, names)
del names['__builtins__']
return names[var]
>>> names = { 'a': 3, 'b': 2, 'x': 'a+b', 'y': 'x*a', 'z': 'x+y' }
>>> evaluate('z', names)
20
>>> names
{'a': 3, 'b': 2, 'y': 15, 'x': 5, 'z': 20}
>>>
> So as you say, I could do:
> x=eval(x), y=eval(y), z=eval(z) and finally eval("z+y+x") but the
> problem is that the initial strings are in no particular order, so I
> don't know the sequence in which to perform the first 3 evaluations. I
> was wondering if there was a simple way to 'pattern-match' so that the
> required substitutions like z->x+y->x+x*a->(a+b)+(a+b)*a could be done
> automatically.
>
Sounds a bit of an odd thing to do, but:
>>> def evaluate(var, names):
expr = names[var]
names['__builtins__'] = {}
if isinstance(expr, basestring):
del names[var]
code = compile(expr, "<%s>"%var, "eval")
for v in code.co_names:
evaluate(v, names)
names[var] = eval(code, names, names)
del names['__builtins__']
return names[var]
>>> names = { 'a': 3, 'b': 2, 'x': 'a+b', 'y': 'x*a', 'z': 'x+y' }
>>> evaluate('z', names)
20
>>> names
{'a': 3, 'b': 2, 'y': 15, 'x': 5, 'z': 20}
>>>
From: alper soyler <[EMAIL PROTECTED]>
Precedence: list
MIME-Version: 1.0
Cc: Python-list@python.org
To: [EMAIL PROTECTED]
Date: Thu, 31 Aug 2006 06:31:54 -0700 (PDT)
Reply-To: alper soyler <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: multipart/alternative; boundary="0-1708806725-1157031114=:13106"
Subject: Re: a question about my script
Message: 6
Precedence: list
MIME-Version: 1.0
Cc: Python-list@python.org
To: [EMAIL PROTECTED]
Date: Thu, 31 Aug 2006 06:31:54 -0700 (PDT)
Reply-To: alper soyler <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: multipart/alternative; boundary="0-1708806725-1157031114=:13106"
Subject: Re: a question about my script
Message: 6
Hi,
I changed the script as you wrote below:
from ftplib import FTP
def handleDownload(block):
file.write(block)
print ".",
ftp = FTP('ftp.genome.jp')
print ftp.login()
directory = 'pub/kegg/genomes'
ftp.cwd(directory)
k=0
for direct in ftp.nlst():
curdir = '%s/%s' % (directory, direct)
ftp.cwd(curdir)
for filename in ftp.nlst():
if not filename.endswith('.pep'): continue
file = open(filename, 'wb')
ftp.retrbinary('RETR %s/%s' % (curdir, filename), handleDownload)
file.close()
k=k+1
print ftp.close()
However, it gave the same error message:
230 Anonymous access granted, restrictions apply.
Traceback (most recent call last):
File "ftp1.0.py", line 18, in ?
ftp.cwd(curdir)
File "/usr/lib/python2.4/ftplib.py", line 494, in cwd
return self.voidcmd(cmd)
File "/usr/lib/python2.4/ftplib.py", line 246, in voidcmd
return self.voidresp()
File "/usr/lib/python2.4/ftplib.py", line 221, in voidresp
resp = self.getresp()
File "/usr/lib/python2.4/ftplib.py", line 216, in getresp
raise error_perm, resp
ftplib.error_perm: 550 pub/kegg/genomes/aae: No such file or directory
However, in ftp.genome.jp/pub/kegg/genomes/ site, there is 'aae' directory. What can be the reason?
regards,
alper
I changed the script as you wrote below:
from ftplib import FTP
def handleDownload(block):
file.write(block)
print ".",
ftp = FTP('ftp.genome.jp')
print ftp.login()
directory = 'pub/kegg/genomes'
ftp.cwd(directory)
k=0
for direct in ftp.nlst():
curdir = '%s/%s' % (directory, direct)
ftp.cwd(curdir)
for filename in ftp.nlst():
if not filename.endswith('.pep'): continue
file = open(filename, 'wb')
ftp.retrbinary('RETR %s/%s' % (curdir, filename), handleDownload)
file.close()
k=k+1
print ftp.close()
However, it gave the same error message:
230 Anonymous access granted, restrictions apply.
Traceback (most recent call last):
File "ftp1.0.py", line 18, in ?
ftp.cwd(curdir)
File "/usr/lib/python2.4/ftplib.py", line 494, in cwd
return self.voidcmd(cmd)
File "/usr/lib/python2.4/ftplib.py", line 246, in voidcmd
return self.voidresp()
File "/usr/lib/python2.4/ftplib.py", line 221, in voidresp
resp = self.getresp()
File "/usr/lib/python2.4/ftplib.py", line 216, in getresp
raise error_perm, resp
ftplib.error_perm: 550 pub/kegg/genomes/aae: No such file or directory
However, in ftp.genome.jp/pub/kegg/genomes/ site, there is 'aae' directory. What can be the reason?
regards,
alper
----- Original Message ----
From: Gabriel Genellina <[EMAIL PROTECTED]>
To: alper soyler <[EMAIL PROTECTED]>
Cc: Python-list@python.org
Sent: Tuesday, August 29, 2006 10:26:57 AM
Subject: Re: a question about my script
From: Gabriel Genellina <[EMAIL PROTECTED]>
To: alper soyler <[EMAIL PROTECTED]>
Cc: Python-list@python.org
Sent: Tuesday, August 29, 2006 10:26:57 AM
Subject: Re: a question about my script
At Tuesday 29/8/2006 03:55, alper soyler wrote:
>I am trying to get some files from an ftp site by ftplib module and
>I wrote the below script. However I have a problem. With my script,
>I login to ftp.genome.jp site. then, I am changing the directory to
>pub/kegg/genomes/afm and I am downloading "a.fumigatus.pep" file.
>However, what I want is to connect pub/kegg/genomes directory and in
>this directory there are 3 letters name files
3 letters *files*? or 3 letters *directories*?
>e.g. 'afm' and in each of these 3 letters files there is a file with
>the extension of '.pep' like a.fumigatus.pep. I want to get these
>'.pep' files from the 3 letter named files. If you help me I will be
>very glad. Thanks you in advance.
Do a cwd() starting one level above (that is, pub/kegg/genomes);
using ftp.dir() you can get the subdirectories, then iterate over all
of them, using another dir() to find the .pep files needed.
>directory = 'pub/kegg/genomes/ afm'
Is that whitespace intentional?
(If you just want to download the files and don't need really a
Python script, try wget...)
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
>I am trying to get some files from an ftp site by ftplib module and
>I wrote the below script. However I have a problem. With my script,
>I login to ftp.genome.jp site. then, I am changing the directory to
>pub/kegg/genomes/afm and I am downloading "a.fumigatus.pep" file.
>However, what I want is to connect pub/kegg/genomes directory and in
>this directory there are 3 letters name files
3 letters *files*? or 3 letters *directories*?
>e.g. 'afm' and in each of these 3 letters files there is a file with
>the extension of '.pep' like a.fumigatus.pep. I want to get these
>'.pep' files from the 3 letter named files. If you help me I will be
>very glad. Thanks you in advance.
Do a cwd() starting one level above (that is, pub/kegg/genomes);
using ftp.dir() you can get the subdirectories, then iterate over all
of them, using another dir() to find the .pep files needed.
>directory = 'pub/kegg/genomes/ afm'
Is that whitespace intentional?
(If you just want to download the files and don't need really a
Python script, try wget...)
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
From: [EMAIL PROTECTED]
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
Date: 31 Aug 2006 06:35:19 -0700
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
Subject: simultaneous copy to multiple media
Message: 7
Precedence: list
MIME-Version: 1.0
To: python-list@python.org
Date: 31 Aug 2006 06:35:19 -0700
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
Subject: simultaneous copy to multiple media
Message: 7
I need a program that simultaneously can copy a single file (1 GB) from
my pc to multiple USB-harddrives.
I have searched the internet and only found one program that does this
on
http://mastermind.com.pl/multicopy/
but this link doesnt work anymore???? somebody that can help me, is
there any other programs out there.
my pc to multiple USB-harddrives.
I have searched the internet and only found one program that does this
on
http://mastermind.com.pl/multicopy/
but this link doesnt work anymore???? somebody that can help me, is
there any other programs out there.
-- http://mail.python.org/mailman/listinfo/python-list