Thanks for the explanation. It's clearer now.
Tommy
"Tommy Kaas" wrote
> > > for row in soup('table', {'class' : 'spad'})[0].tbody('tr'):
> >
> >Do you understand the syntax from a Python point of view?
>
> No. That's the problem.
OK, I'll assume you understand the basic for loop structure
and
"Christian Witts" wrote
When I'm retrieving items I use retrbinary for eg.
The only issue with that is that if this is a real big-iron mainframe
then ftp can translate EBCDIC to ASCII during the transfer whereas
binary will, I think, bring the original file across untranslated.
So you would
On 29/07/2010 18:34, Steve Bricker wrote:
This is my first attempt to FTP a file from a mainframe. The code:
import ftplib
session = ftplib.FTP('company.lan.com','userid','passwd')
myfile = open('PC.filename','w')
session.retrlines("RETR 'mainframe.filename'", myfile)
myfile.close()
session.qui
Hello,
Thanks for the replies.
On Thu, Jul 29, 2010 at 7:10 PM, Gregory, Matthew
wrote:
> Norman Khine wrote:
>> basically i have two tables:
>>
>> id, url
>> 24715L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
>> 24719L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
>>
>> i
On Thu, Jul 29, 2010 at 10:16 PM, James Mills
wrote:
> On Fri, Jul 30, 2010 at 12:10 PM, James Mills
> wrote:
>> def gcd(a, b):
>> while b != 0:
>> (a, b) = (b, a%b)
>> return a
That was pretty short, and sweet.
>
> Here's another solution that uses a generator called factors to
>
On Thu, Jul 29, 2010 at 10:36 PM, James Mills
wrote:
> On Fri, Jul 30, 2010 at 12:22 PM, Richard D. Moores
> wrote:
>> On Thu, Jul 29, 2010 at 19:10, James Mills
>> wrote:
>>> On Fri, Jul 30, 2010 at 11:47 AM, David Hutto wrote:
This is basically to get feedback, on a better way to show
On Fri, Jul 30, 2010 at 12:22 PM, Richard D. Moores wrote:
> On Thu, Jul 29, 2010 at 19:10, James Mills
> wrote:
>> On Fri, Jul 30, 2010 at 11:47 AM, David Hutto wrote:
>>> This is basically to get feedback, on a better way to show the
>>> greatest common divisor in fraction, in order to reduce
On Thu, Jul 29, 2010 at 19:10, James Mills wrote:
> On Fri, Jul 30, 2010 at 11:47 AM, David Hutto wrote:
>> This is basically to get feedback, on a better way to show the
>> greatest common divisor in fraction, in order to reduce it fully, than
>> the one I've come up with. I'm sure there are bet
On Fri, Jul 30, 2010 at 12:10 PM, James Mills
wrote:
> def gcd(a, b):
> while b != 0:
> (a, b) = (b, a%b)
> return a
Here's another solution that uses a generator called factors to
generate a list of factors for any given value. The gcd function
then uses sets and intersection and th
On Fri, Jul 30, 2010 at 11:47 AM, David Hutto wrote:
> This is basically to get feedback, on a better way to show the
> greatest common divisor in fraction, in order to reduce it fully, than
> the one I've come up with. I'm sure there are better ways, so if you
> have simpler method, or critique o
This is basically to get feedback, on a better way to show the
greatest common divisor in fraction, in order to reduce it fully, than
the one I've come up with. I'm sure there are better ways, so if you
have simpler method, or critique of what I've done, let me know.
'''Greatest Common Divisor Fu
On Wed, Jul 28, 2010 at 08:35, Richard D. Moores wrote:
> Now I'll dig into all the help I received. I see an *args in Steven's
> detailed reply. That'll take some reviewing to understand.
Here's my slight revision of Steven's script (see my note, lines 9-14)
-- revised only because I wanted it
On Thu, Jul 29, 2010, bob gailer wrote:
>
> On 7/29/2010 12:34 PM, Steve Bricker wrote:
>
> This is my first attempt to FTP a file from a mainframe. The code:
> import ftplib
The easiest way I've found to get a file via ftp in python is to
user urllib, not ftplib. Something like this (
"Steve Bricker" wrote
}This is my first attempt to FTP a file from a mainframe.
Thats one more than me!
The resulting error is:
session.retrlines("RETR 'mainframe.filename'", myfile)
File "c:python26libftplib.py", line 428, in retrlines
callback(line)
TypeError: 'file' object is n
On 7/29/2010 12:34 PM, Steve Bricker wrote:
This is my first attempt to FTP a file from a mainframe. The code:
import ftplib
session = ftplib.FTP('company.lan.com','userid','passwd')
myfile = open('PC.filename','w')
session.retrlines("RETR 'mainframe.filename'", myfile)
myfile.close()
session.q
Norman Khine wrote:
> basically i have two tables:
>
> id, url
> 24715L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
> 24719L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
>
> id, tid,
> 1, 24715L
> 2, 24719L
>
> so i want to first update t(2)'s tid to t(1)'s id for each d
Norman Khine wrote:
> hello,
>
> i have this tuple:
>
> http://paste.lisp.org/+2F4X
>
> i have this, which does what i want:
>
> from collections import defaultdict
>
> d = defaultdict(set)
> for id, url in result:
> d[url].add(id)
> for url in sorted(d):
> if len(d[url]) > 1:
> print('%d --
BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px;
}This is my first attempt to FTP a file from a mainframe. The code:
import ftplib
session = ftplib.FTP('company.lan.com','userid','passwd')
myfile = open('PC.filename','w')
session.retrlines("RETR 'mainframe.filename'", myfile)
myf
hello,
i have this tuple:
http://paste.lisp.org/+2F4X
i have this, which does what i want:
from collections import defaultdict
d = defaultdict(set)
for id, url in result:
d[url].add(id)
for url in sorted(d):
if len(d[url]) > 1:
print('%d -- %s' % (len(d[url]), u
2010/7/28 Dave Angel
> ZUXOXUS wrote:
>
>>
>>
>> My doubt now is whether I can change the way python show the combinations.
>>
>> I mean, here's what python actually does:
>>
>>
>>
>>> for prod in itertools.product('abc', repeat=3):
>
>
print(prod)
>>
>> ('a', 'a', 'a')
>> ('a', 'a'
"Jason MacFiggen" wrote
Python keeps looping when it gets past the int 0, how do I end the
program
when it the int 0 or > 0.
while True:
if mo_hp < 0:
print "The Lich King has been slain!"
elif my_hp < 0:
/etc...
When using a while True loop you need ttto have a
Consider using the django-users Google group for typical Django questions
(unless you figure they're really about Python). Will likely get you better or
more answers.
Anyway:
> Hi
>
> I am building my first Django site which has a lot of effectively 'static'
> pages where I just want to make t
22 matches
Mail list logo