Is there any difference between yield and print in python script?i have
written a script based on fibonacci series where in i used yield and print
in two different scripts:
the script is given below:
def fib(n):
a,b = 0,1
while a<=n:
print a
a,b = b,a+b
for x in fib(4):
print
> Danny - thanks! it works though I am not sure I fully understand what i
> did :-)
Hi Tsila,
When you have time, you may want to take a closer look at how HTTP works.
Here's one place you can look:
http://www.jmarshall.com/easy/http/
If you are writing applications for HTTP, you should
[hijacking the "question about object oriented programming and
inheritance using datetime module" thread here]
On Tue, 16 Jan 2007, Kent Johnson wrote:
> I think you are missing the line
>datetime.date.__init__(self, year, month, day)
> somewhere in here.
Yeah; sloppy of me.
> I am ver
-- Forwarded message --
Date: Wed, 17 Jan 2007 02:08:48 +0100
From: Tsila Hassine <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] dealing with 406 HTTP response
Danny - thanks! it works though I am not sure I fully understand what i did
:-)
I am iverri
At 12:45 PM 1/16/2007, Kent Johnson wrote:
>Dick Moores wrote:
>>Thanks, Kent. So I go with working up "an algorithm for first
>>converting n to an int (for
>>example, multiplying the above n by 1000), converting to a string,
>>putting the decimal point back in between indices 2 and 3, then using
On Tue, 16 Jan 2007, Tsila Hassine wrote:
> has anybody dealt with a 406 reponse through a urllib.FancyURLopener
> class ? I have a code that downloads images from websites and soemsites
> respond with an 406 which I don't know how to handle
Hi Tsila,
Have you looked at the description of a
"Carlos" <[EMAIL PROTECTED]> wrote
>>> from cluster import *
>>> data = [12,34,23,32,46,96,13]
>>> cl = HierarchicalClustering(data, lambda x,y: abs(x-y))
>>> cl.getlevel(10) # get clusters of items closer than 10
[96, 46, [12, 13, 23, 34, 32]]
> I would like to give it a try because I have
Dear pythoners,
has anybody dealt with a 406 reponse through a urllib.FancyURLopener class
?
I have a code that downloads images from websites and soemsites respond with
an 406 which I don't know how to handle
thanks!
Tsila
___
Tutor maillist - Tuto
Hi,
I'm writing a program that downloads audio streams from the net, to do
this I use mplayer and tcpdump, which I kick off as detached processes
(if thats the correct terminology), I do it this way because i'm using
pygtk and I dont want the program to wait for the processes to finish
otherwise th
At 12:47 PM 1/16/2007, you wrote:
>On Tue, 2007-01-16 at 12:28 -0800, Dick Moores wrote:
> > So I go with working up "an algorithm for first
> > converting n to an int (for
> > example, multiplying the above n by 1000), converting to a string,
> > putting the decimal point back in between indices 2
On Tue, 2007-01-16 at 12:28 -0800, Dick Moores wrote:
> So I go with working up "an algorithm for first
> converting n to an int (for
> example, multiplying the above n by 1000), converting to a string,
> putting the decimal point back in between indices 2 and 3, then using
> that string as n (the
Dick Moores wrote:
> Thanks, Kent. So I go with working up "an algorithm for first
> converting n to an int (for
> example, multiplying the above n by 1000), converting to a string,
> putting the decimal point back in between indices 2 and 3, then using
> that string as n (thereby avoiding the use
On Tue, 16 Jan 2007, Dick Moores wrote:
> Here's a function I wrote some time ago, and just discovered that in
> one important category of cases, long numbers with a decimal point,
> it doesn't do what I intended.
>
> =
> def numberRounding(n,
At 12:16 PM 1/16/2007, Kent Johnson wrote:
>Dick Moores wrote:
> > Here's a function I wrote some time ago, and just discovered that in
> > one important category of cases, long numbers with a decimal point,
> > it doesn't do what I intended.
> >
> >
Dick Moores wrote:
> Here's a function I wrote some time ago, and just discovered that in
> one important category of cases, long numbers with a decimal point,
> it doesn't do what I intended.
>
> =
> def numberRounding(n, significantDigits=4):
Terry Carroll wrote:
> An example is if you wanted to create a "birthdate" class, which was just
> like a regular date, but also included the birthstone that corresponded to
> the date. We could create a "birthdate" module that included a
> "Birthdate" class:
>
> ###
>
> import da
Here's a function I wrote some time ago, and just discovered that in
one important category of cases, long numbers with a decimal point,
it doesn't do what I intended.
=
def numberRounding(n, significantDigits=4):
"""
Rounds a n
On Mon, 15 Jan 2007, Kent Johnson wrote:
> [EMAIL PROTECTED] wrote:
>
> > My class inherits from the date class, but I
> > have to type 'from datetime import date' before I can initialize the
> > class definition. Is there some way to avoid this ?
>
> No, and really there is no reason to wan
On 1/16/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote:
On Tue, Jan 16, 2007 at 11:28:49AM -0500, Joe Abbey wrote:
> Hello,
>
> I'm using Active Python v2.4.3.11 on a Windows XP machine.
>
> Probably more relevant is that I'm just learning Python, as in I've been
> writing Python for less than 24 ho
Hallo ,
Andre thanks a lot for your help, seems to me like my script can work
with your function.
I found this searching the internet:
cluster 1.1.1b2
python-cluster is a "simple" package that allows to create several
groups (clusters) of objects from a list
>>> from cluster import *
>>> da
On Tue, Jan 16, 2007 at 11:28:49AM -0500, Joe Abbey wrote:
> Hello,
>
> I'm using Active Python v2.4.3.11 on a Windows XP machine.
>
> Probably more relevant is that I'm just learning Python, as in I've been
> writing Python for less than 24 hours.
>
> While trying to implement a PE parser, I ra
On Tue, 16 Jan 2007 09:56:27 + (GMT)
ALAN GAULD <[EMAIL PROTECTED]> wrote:
>
> --- Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:
>
> > Is there a method that redraws the toplevel windows that is
> > holding the widgets
>
> Yes, you can issue an update() command to any widget.
> Usually yo
> While trying to implement a PE parser, I ran into the following problem:
>
> #** START CODE***
> data = file.read(128);
> directoryTable = struct.unpack('', data);
> i=0;
> print "Export table 0x%08X + 0x%08x" % (directoryTable
Hello,
I'm using Active Python v2.4.3.11 on a Windows XP machine.
Probably more relevant is that I'm just learning Python, as in I've been
writing Python for less than 24 hours.
While trying to implement a PE parser, I ran into the following problem:
#** START CODE*
Andreas Kostyrka wrote:
> * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [070116 15:19]:
>> is there a difference between:
>>
>> class foo:
>>
>> and
>>
>> class foo():
> This is a SyntaxError.
In Python 2.5 it is allowed and creates an old-style class, the same as
if the parentheses are omitted.
Kent
On Tue, 16 Jan 2007, Andreas Kostyrka wrote:
> * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [070116 15:19]:
>>
>> is there a difference between:
>>
>> class foo:
>>
>> and
>>
>> class foo():
> This is a SyntaxError.
Hi Andreas,
We should ask Emilia why she's asking this question. This particular
> I wondered if it was possible to do something like this:
>
> src/
>-a_module/
>-sub_module/
> test/
>-a_module/
>-sub_module/
Why not really keep the test code with the main code?
# module code here
#
if __name__ == '__main__':
import unittest
class TestModul
2007/1/16, Carlos <[EMAIL PROTECTED]>:
Hello to everybody,
I have a question that I think is a little related to clustering, I have
a list of lists, like this:
List = [[1,5],[6,8],[48,10],[99,56]]
The list is composed by a large number of lists not just four, and each
'interior' list contains
Thomas Coopman wrote:
> Hi,
>
> the documentation of pyunit
> say that it is good to place the unittest in a seperate module.
> I wondered if it was possible to do something like this:
>
> src/
> -a_module/
> -sub_module/
> test/
> -a_module/
> -sub_module/
>
> So the te
Alexander Kapshuk wrote:
> Dear All,
>
>
>
> My name is Alexander Kapshuk. I’m interested in learning to program in
> Python. I have very little programming experience. I’ve learnt some
> basics of programming with Logo.
>
> I’ve downloaded Python 2.5 for Windows XP Professional.
>
> I woul
--- Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:
> Is there a method that redraws the toplevel windows that is
> holding the widgets
Yes, you can issue an update() command to any widget.
Usually you don't need to as Tkinter figures out when
things have changed and updates itself, but
occasi
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Alexander Kapshuk
> Sent: Tuesday, January 16, 2007 2:50 AM
> To: tutor@python.org
> Subject: Re: [Tutor] python query
>
> Dear All,
>
>
>
> My name is Alexander Kapshuk. I'm interested in learn
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [070116 15:19]:
>
> is there a difference between:
>
> class foo:
>
> and
>
> class foo():
This is a SyntaxError.
>
> or between these function definitions:
>
> def bar():
>
> and
>
> def bar:
This too.
Andreas
___
Hello to everybody,
I have a question that I think is a little related to clustering, I have
a list of lists, like this:
List = [[1,5],[6,8],[48,10],[99,56]]
The list is composed by a large number of lists not just four, and each
'interior' list contains two numbers that are the location of an
is there a difference between:
class foo:
and
class foo():
or between these function definitions:
def bar():
and
def bar:
?
thanks in advance
E.
-
Станете част от Европейското On-line семейство!
Регистрирайте .EU домейн на изключителна цена от 15,90 лв.!
w
On Tue, 16 Jan 2007 10:06:37 -
"Alan Gauld" <[EMAIL PROTECTED]> wrote:
>
> "Thomas Coopman" <[EMAIL PROTECTED]> wrote
> .
> > I wondered if it was possible to do something like this:
> >
> > src/
> >-a_module/
> >-sub_module/
> > test/
> >-a_module/
> >-sub_module/
> >
"Thomas Coopman" <[EMAIL PROTECTED]> wrote
.
> I wondered if it was possible to do something like this:
>
> src/
>-a_module/
>-sub_module/
> test/
>-a_module/
>-sub_module/
>
I don;t see any reason why not although its slightly more work.
Personally I tend to keep the test
Dear All,
My name is Alexander Kapshuk. I'm interested in learning to program in
Python. I have very little programming experience. I've learnt some
basics of programming with Logo.
I've downloaded Python 2.5 for Windows XP Professional.
I would appreciate any advice on what to do next
"Michael Lange" <[EMAIL PROTECTED]> wrote
> If you only want to be able to resize the graph elements
> into half and double size it is probably easiest to use the
> Canvas.scale() method for this, like
>
from Tkinter import *
c=Canvas()
c.pack(fill='both', expand=1)
r = c.
On Tue, 16 Jan 2007 00:33:20 -
"Alan Gauld" <[EMAIL PROTECTED]> wrote:
>
> "Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote
>
> > I want to provide with a functionality of changing the font size, in
> > this
> > case the width of the lines.
> Its not really the font size. fonts only apply to te
I want to change the coordinates because I was under the wrong impression;
when I gave some thought then only I realised that the COORDINATES need to
be changed in order to increase the dimensions of the GRAPH and in turn the
entire frame, canvas, and the toplevel window that is holding the frame
Hi,
the documentation of pyunit
say that it is good to place the unittest in a seperate module.
I wondered if it was possible to do something like this:
src/
-a_module/
-sub_module/
test/
-a_module/
-sub_module/
So the test are in a complete different directory than the code
42 matches
Mail list logo