I started seting up django. the only issue I am having is that all instructions seem to assume that I am on linux.Don't suppose there are any good instructions for those on a windows based system.<br><br><div class="gmail_quote">
On Sat, Sep 25, 2010 at 8:00 PM, <span dir="ltr"><<a href="mailto:tutor-request@python.org">tutor-request@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Send Tutor mailing list submissions to<br>
<a href="mailto:tutor@python.org">tutor@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:tutor-request@python.org">tutor-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:tutor-owner@python.org">tutor-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Tutor digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: pure function problem (Dave Angel)<br>
2. Re: pure function problem (Roelof Wobben)<br>
3. Re: Plotting a Linear Equation (<a href="mailto:kb1pkl@aim.com">kb1pkl@aim.com</a>)<br>
4. Re: list.append(x) but at a specific 'i' (Norman Khine)<br>
5. Python And reading the Web - Javascript (Sayth Renshaw)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 24 Sep 2010 06:29:03 -0400<br>
From: Dave Angel <<a href="mailto:davea@ieee.org">davea@ieee.org</a>><br>
To: Roelof Wobben <<a href="mailto:rwobben@hotmail.com">rwobben@hotmail.com</a>><br>
Cc: <a href="mailto:tutor@python.org">tutor@python.org</a><br>
Subject: Re: [Tutor] pure function problem<br>
Message-ID: <<a href="mailto:4C9C7D6F.5080700@ieee.org">4C9C7D6F.5080700@ieee.org</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
On 2:59 PM, Roelof Wobben wrote:<br>
><br>
><br>
> ----------------------------------------<br>
>> From: <a href="mailto:steve@pearwood.info">steve@pearwood.info</a><br>
>> <snip><br>
>> On Fri, 24 Sep 2010 06:20:25 am Roelof Wobben wrote:<br>
>><br>
>>> time =ijd()<br>
>> [...]<br>
>>> print time(uitkomst)<br>
>> Why are you calling time as a function, when it is a tijd instance?<br>
>><br>
>> <snip><br>
><br>
> Hello Steve,<br>
><br>
> I found this in my tutorial.<br>
><br>
> 13.8. Instances as return values?<br>
> Functions can return instances. For example, find_center takes a Rectangle as an argument and returns a Point that contains the coordinates of the center of the Rectangle:<br>
> def find_center(box):<br>
> p =oint()<br>
> p.x =ox.corner.x + box.width/2.0<br>
> p.y =ox.corner.y - box.height/2.0<br>
> return p<br>
> To call this function, pass box as an argument and assign the result to a variable:<br>
>>>> center =ind_center(box)<br>
>>>> print_point(center)<br>
> (50.0, 100.0)<br>
><br>
><br>
> So i followed it but appearently not the good way.<br>
><br>
> Roelof<br>
There's a big difference between print_point() and print time().<br>
<br>
print_point() in your tutorial is a function, presumably defined<br>
someplace else.<br>
<br>
You used print time(), (no underscore), which uses the print statement,<br>
and tries to call a function called time().<br>
<br>
Since you defined time as an instance of your class, and didn't do<br>
anything special, it's not callable.<br>
<br>
DaveA<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 24 Sep 2010 10:40:46 +0000<br>
From: Roelof Wobben <<a href="mailto:rwobben@hotmail.com">rwobben@hotmail.com</a>><br>
Cc: <<a href="mailto:tutor@python.org">tutor@python.org</a>><br>
Subject: Re: [Tutor] pure function problem<br>
Message-ID: <SNT118-W46627FE73899BE912DE70DAE620@phx.gbl><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
<br>
<br>
<br>
----------------------------------------<br>
> Date: Fri, 24 Sep 2010 06:29:03 -0400<br>
> From: <a href="mailto:davea@ieee.org">davea@ieee.org</a><br>
> To: <a href="mailto:rwobben@hotmail.com">rwobben@hotmail.com</a><br>
> CC: <a href="mailto:tutor@python.org">tutor@python.org</a><br>
> Subject: Re: [Tutor] pure function problem<br>
><br>
> On 2:59 PM, Roelof Wobben wrote:<br>
>><br>
>><br>
>> ----------------------------------------<br>
>>> From: <a href="mailto:steve@pearwood.info">steve@pearwood.info</a><br>
>>><br>
>>> On Fri, 24 Sep 2010 06:20:25 am Roelof Wobben wrote:<br>
>>><br>
>>>> time =ijd()<br>
>>> [...]<br>
>>>> print time(uitkomst)<br>
>>> Why are you calling time as a function, when it is a tijd instance?<br>
>>><br>
>>><br>
>><br>
>> Hello Steve,<br>
>><br>
>> I found this in my tutorial.<br>
>><br>
>> 13.8. Instances as return values?<br>
>> Functions can return instances. For example, find_center takes a Rectangle as an argument and returns a Point that contains the coordinates of the center of the Rectangle:<br>
>> def find_center(box):<br>
>> p =oint()<br>
>> p.x =ox.corner.x + box.width/2.0<br>
>> p.y =ox.corner.y - box.height/2.0<br>
>> return p<br>
>> To call this function, pass box as an argument and assign the result to a variable:<br>
>>>>> center =ind_center(box)<br>
>>>>> print_point(center)<br>
>> (50.0, 100.0)<br>
>><br>
>><br>
>> So i followed it but appearently not the good way.<br>
>><br>
>> Roelof<br>
> There's a big difference between print_point() and print time().<br>
><br>
> print_point() in your tutorial is a function, presumably defined<br>
> someplace else.<br>
><br>
> You used print time(), (no underscore), which uses the print statement,<br>
> and tries to call a function called time().<br>
><br>
> Since you defined time as an instance of your class, and didn't do<br>
> anything special, it's not callable.<br>
><br>
> DaveA<br>
><br>
<br>
Oke,<br>
<br>
I see it now.<br>
I have to us a function that i had to write a few questions before.<br>
<br>
Thanks everybody<br>
<br>
Roelof<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 24 Sep 2010 12:26:31 -0400 (EDT)<br>
From: <a href="mailto:kb1pkl@aim.com">kb1pkl@aim.com</a><br>
To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>
Subject: Re: [Tutor] Plotting a Linear Equation<br>
Message-ID: <<a href="mailto:8CD2A1C6185AFCF-854-182@webmail-m060.sysops.aol.com">8CD2A1C6185AFCF-854-182@webmail-m060.sysops.aol.com</a>><br>
Content-Type: text/plain; charset="utf-8"; format=flowed<br>
<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: Greg <<a href="mailto:gregbair@gmail.com">gregbair@gmail.com</a>><br>
To: tutor <<a href="mailto:tutor@python.org">tutor@python.org</a>><br>
Sent: Fri, Sep 24, 2010 3:29 am<br>
Subject: Re: [Tutor] Plotting a Linear Equation<br>
<br>
<br>
On Thu, Sep 23, 2010 at 10:51 PM, Corey Richardson <<a href="mailto:kb1pkl@aim.com">kb1pkl@aim.com</a>><br>
wrote:<br>
<br>
?Hello tutors. Probably the wrong mailing list, but someone might know.<br>
I want to use matplotlib (or similar) to plot an equation in<br>
slope-intercept (y=mx+b) or standard form (Ax + By = C). As far as I've<br>
read and tested, you can only plot with a series of points. I could<br>
make two points out of those manually, but I was wondering if anyone<br>
knew of an easier way. Thanks.<br>
<br>
<br>
<br>
You could just have your program compute the x- and y- intercepts, then<br>
plug them into matplotlib. ?Am I correct in that??<br>
<br>
<br>
--<br>
Greg Bair<br>
<a href="mailto:gregbair@gmail.com">gregbair@gmail.com</a><br>
______________________________________________________________________<br>
Yes, you are correct. That's what I planned on doing if I couldn't plug<br>
the equation right into matplotlib.<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Fri, 24 Sep 2010 19:58:44 +0200<br>
From: Norman Khine <<a href="mailto:norman@khine.net">norman@khine.net</a>><br>
To: Python tutor <<a href="mailto:tutor@python.org">tutor@python.org</a>><br>
Subject: Re: [Tutor] list.append(x) but at a specific 'i'<br>
Message-ID:<br>
<<a href="mailto:AANLkTinq%2B%2BWr%2BN6FHtObjXs2AOOG8O1o4CK1NvUAzgts@mail.gmail.com">AANLkTinq++Wr+N6FHtObjXs2AOOG8O1o4CK1NvUAzgts@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
On Wed, Sep 22, 2010 at 9:47 PM, Steven D'Aprano <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>> wrote:<br>
> On Wed, 22 Sep 2010 08:30:09 am Norman Khine wrote:<br>
><br>
>> hello, how do i extend a python list but from a given [i],<br>
><br>
> Do you mean to modify the list in place, like append() and extend() do,<br>
> or do you mean to create a new list, like + does?<br>
><br>
><br>
>> for example:<br>
>> >>> a = ['a', 'b', 'e']<br>
>> >>> b = ['c', 'd']<br>
>> >>><br>
>> >>> a + b<br>
>><br>
>> ['a', 'b', 'e', 'c', 'd']<br>
>><br>
>><br>
>> but i want to put the items of 'b' at [-2] for example.<br>
><br>
> When you ask a question, it usually helps to show the output you *want*,<br>
> not the output you *don't want*, rather than to make assumptions about<br>
> what other people will understand.<br>
><br>
> When you say that you want the items of b *at* -2, taken literally that<br>
> could mean:<br>
><br>
>>>> a = ['a', 'b', 'e']<br>
>>>> b = ['c', 'd']<br>
>>>> a.insert(-2+1, b)<br>
>>>> print(a)<br>
> ['a', 'b', ['c', 'd'], 'e']<br>
><br>
> Note that the items of b are kept as a single item, at the position you<br>
> ask for, and the index you pass to insert() is one beyond when you want<br>
> them to appear.<br>
><br>
> To create a new list, instead of insert() use slicing:<br>
><br>
>>>> a[:-2+1] + [b] + a[-2+1:]<br>
> ['a', 'b', ['c', 'd'], 'e']<br>
><br>
><br>
> If you want the items of b to *start* at -2, since there are exactly two<br>
> items, extend() will do the job for in-place modification, otherwise +.<br>
> But you already know that, because that was your example.<br>
><br>
> If you want the items of b to *end* at -2, so that you get<br>
> ['a', 'b', 'c', 'd', 'e'] then you could use repeated insertions:<br>
><br>
> for c in b:<br>
> ? ?a.insert(-2, c)<br>
><br>
> but that will likely be slow for large lists. Better to use slicing. To<br>
> create a new list is just like the above, except you don't create a<br>
> temporary list-of-b first:<br>
><br>
>>>> a[:-2+1] + b + a[-2+1:]<br>
> ['a', 'b', 'c', 'd', 'e']<br>
><br>
><br>
> To do it in place, assign to a slice:<br>
><br>
>>>> a[-2:-2] = b<br>
>>>> print(a)<br>
> ['a', 'c', 'd', 'b', 'e']<br>
<br>
thanks for all the replies, and the detailed information<br>
><br>
><br>
><br>
> --<br>
> Steven D'Aprano<br>
> _______________________________________________<br>
> Tutor maillist ?- ?<a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
> To unsubscribe or change subscription options:<br>
> <a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
><br>
<br>
<br>
<br>
--<br>
?u?op ?p?sdn p,u?n? p??o? ??? ??s no? '?u???? s???? ??? pu? '?u??uo?<br>
?q s,??? ???<br>
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or<br>
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Sat, 25 Sep 2010 19:29:34 +1000<br>
From: Sayth Renshaw <<a href="mailto:flebber.crue@gmail.com">flebber.crue@gmail.com</a>><br>
To: <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
Subject: [Tutor] Python And reading the Web - Javascript<br>
Message-ID:<br>
<<a href="mailto:AANLkTinM5XOc8riMeoGF6eLqg5PGxW-e4fDpEy0evg3J@mail.gmail.com">AANLkTinM5XOc8riMeoGF6eLqg5PGxW-e4fDpEy0evg3J@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Was hoping some could push me in the right direction about reading<br>
data from web pages and what modules to use. Is there support for<br>
reading if the page uses javascript?<br>
<br>
If you know any good links to tutorials for this it would be great. I<br>
was planning to use python 2.6 currently.<br>
<br>
I want to read some data from the web it will be text and numeric i<br>
was planning to export it to a database. I was thinking while I am<br>
learning maybe something simple like Sqlite or MySQL.<br>
<br>
I then want to read back data to perform sorting and some calculations on.<br>
<br>
Any ideas in general in how to do this appreciated. i don't mind<br>
reading so if you have some good links they are appreciated.<br>
<br>
Thank You<br>
<br>
Sayth<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br>
<br>
End of Tutor Digest, Vol 79, Issue 134<br>
**************************************<br>
</blockquote></div><br>