Re: [Tutor] Tips

2014-06-19 Thread Albert-Jan Roskam
- Original Message - > From: Steven D'Aprano > To: tutor@python.org > Cc: > Sent: Thursday, June 19, 2014 3:17 AM > Subject: Re: [Tutor] Tips > > On Wed, Jun 18, 2014 at 07:25:41AM -0700, Albert-Jan Roskam wrote: > >> Given that the concept of Ducktyping has already been mentioned,

Re: [Tutor] Tips

2014-06-19 Thread Albert-Jan Roskam
- Original Message - > From: Mark Lawrence > To: tutor@python.org > Cc: > Sent: Thursday, June 19, 2014 8:41 AM > Subject: Re: [Tutor] Tips > > On 19/06/2014 02:36, Danny Yoo wrote: >> [content about __add__ dispatch resolution cut] >> >> >> We should remember the target audience,

Re: [Tutor] Tips

2014-06-19 Thread Sydney Shall
On 19/06/2014 03:37, Steven D'Aprano wrote: On Wed, Jun 18, 2014 at 12:35:20PM +0200, Sydney Shall wrote: On 17/06/2014 22:35, Alan Gauld wrote: Use modules instead of singleton classes As a new beginner with Python, I am having problem understanding the difference here. I think I understand c

[Tutor] python libraries online

2014-06-19 Thread Ian D
A while back some one linked to the python source and I was able to view the whole of its libraries and class files something like this java api site http://docs.oracle.com/javase/7/docs/api/ But I cant seem to find what I want now. I wanted to be able to look at the classes etc Anyone help

Re: [Tutor] python libraries online

2014-06-19 Thread Steven D'Aprano
On Thu, Jun 19, 2014 at 12:18:35PM +, Ian D wrote: > A while back some one linked to the python source and I was able to > view the whole of its libraries and class files something like this > java api site http://docs.oracle.com/javase/7/docs/api/ http://hg.python.org/cpython/file/cf70f030

Re: [Tutor] Tips

2014-06-19 Thread Steven D'Aprano
On Wed, Jun 18, 2014 at 06:36:12PM -0700, Danny Yoo wrote: > [content about __add__ dispatch resolution cut] > > > We should remember the target audience, lest this thread doesn't > spiral away so that only the tutors are talking to each other. I'm > guilty of this as anyone, mind you. Pot. Ke

Re: [Tutor] python libraries online

2014-06-19 Thread Ian D
Ok Thanks. I will look on the computer, it seems that the online repository is not so easy to search. i.e If I search csv I get all the changes all the merges... but I just want the class file > Date: Thu, 19 Jun 2014 22:23:01 +1000 > From: st...@pear

Re: [Tutor] python libraries online

2014-06-19 Thread Ian D
And I wondered what 'cpython' was when I came across it. I thought they might have called it python > Date: Thu, 19 Jun 2014 22:23:01 +1000 > From: st...@pearwood.info > To: tutor@python.org > Subject: Re: [Tutor] python libraries online > > On Thu, Jun 19

Re: [Tutor] Tips

2014-06-19 Thread Mark Lawrence
On 19/06/2014 10:09, Albert-Jan Roskam wrote: - Original Message - From: Mark Lawrence To: tutor@python.org Cc: Sent: Thursday, June 19, 2014 8:41 AM Subject: Re: [Tutor] Tips On 19/06/2014 02:36, Danny Yoo wrote: [content about __add__ dispatch resolution cut] We should reme

Re: [Tutor] Tips

2014-06-19 Thread Steven D'Aprano
On Tue, Jun 17, 2014 at 02:52:33PM -0400, keith papa wrote: > > Hi, I want to no what some tips or information you can give me to > remember some of the rules of python, when you first start learning > programming? Questions about memory (that is, *human* memory, in the brain) are not really on

Re: [Tutor] python libraries online

2014-06-19 Thread Mark Lawrence
On 19/06/2014 13:37, Ian D wrote: And I wondered what 'cpython' was when I came across it. I thought they might have called it python Cpython because it's written in C. Look closely at the repository you'll find Jython there as well, it's written in Java. There are umpteen other Python ve

Re: [Tutor] Tips

2014-06-19 Thread Albert-Jan Roskam
- Original Message - > From: Mark Lawrence > To: tutor@python.org > Cc: > Sent: Thursday, June 19, 2014 2:40 PM > Subject: Re: [Tutor] Tips > > On 19/06/2014 10:09, Albert-Jan Roskam wrote: >>> From: Mark Lawrence >>> To: tutor@python.org >>> Cc: >>> Sent: Thursday, June 19, 2014 8

Re: [Tutor] python libraries online

2014-06-19 Thread Danny Yoo
On Thu, Jun 19, 2014 at 5:18 AM, Ian D wrote: > A while back some one linked to the python source and I was able to view the > whole of its libraries and class files something like this java api site > http://docs.oracle.com/javase/7/docs/api/ > > > But I cant seem to find what I want now. > > >

Re: [Tutor] python libraries online

2014-06-19 Thread Ian D
What does top post mean? > To: tutor@python.org > From: breamore...@yahoo.co.uk > Date: Thu, 19 Jun 2014 13:46:03 +0100 > Subject: Re: [Tutor] python libraries online > > On 19/06/2014 13:37, Ian D wrote: >> And I wondered what 'cpython' was when I came acr

Re: [Tutor] python libraries online

2014-06-19 Thread Steven D'Aprano
On Thu, Jun 19, 2014 at 12:37:17PM +, Ian D wrote: > And I wondered what 'cpython' was when I came across it. I thought > they might have called it python Python is the name of the programming languages. There are many different implementations of that programming language: - Jython is Pyt

Re: [Tutor] python libraries online

2014-06-19 Thread Steven D'Aprano
On Thu, Jun 19, 2014 at 12:59:58PM +, Ian D wrote: > What does top post mean? It means posting at the top of the reply, just as you have done here. When you reply to an email, the comments you are replying to are quoted with greater-than signs > at the start of each line. There are three ba

Re: [Tutor] python libraries online

2014-06-19 Thread Ian D
> Date: Fri, 20 Jun 2014 00:30:49 +1000 > From: st...@pearwood.info > To: tutor@python.org > Subject: Re: [Tutor] python libraries online > > On Thu, Jun 19, 2014 at 12:59:58PM +, Ian D wrote: >> What does top post mean? > > It means posting at the top

Re: [Tutor] python libraries online

2014-06-19 Thread Mark Lawrence
On 19/06/2014 15:35, Ian D wrote: Ok and do I leave all this rubbish at the bottom? or edit it. Or is it bad practice to edit someone's text ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscri

[Tutor] write dictionary to file

2014-06-19 Thread Ian D
When trying to write my dictionary to a file I get: f.write(output) TypeError: 'tuple' does not support the buffer interface using this example: #so far this should read a file #using dictreader and take a column and join some text onto it import csv csvfile= open('StudentListToSort.csv

Re: [Tutor] write dictionary to file

2014-06-19 Thread Danny Yoo
On Thu, Jun 19, 2014 at 8:13 AM, Ian D wrote: > When trying to write my dictionary to a file I get: > > > f.write(output) > TypeError: 'tuple' does not support the buffer interface When writing structured data to disk files, you need to do something extra, because what disk files support are the

Re: [Tutor] Tips

2014-06-19 Thread Alex Kleider
On 2014-06-18 18:37, Steven D'Aprano wrote: Python tries very hard to ensure that every module is loaded only once. (There are circumstances where you can fool it, but they're rare.) Since the module holds state (variables) and behaviour (functions), modules perform the same sort of role as cla

Re: [Tutor] python libraries online

2014-06-19 Thread Alan Gauld
On 19/06/14 15:35, Ian D wrote: Ok and do I leave all this rubbish at the bottom? or edit it. Delete as much as possible that is not needed to understand the reply. But only as much as necessary, err on the generous side if in doubt. But definitely things like the Python mailing list comments

Re: [Tutor] Tips

2014-06-19 Thread Albert-Jan Roskam
- Original Message - > From: Alex Kleider > To: tutor@python.org > Cc: > Sent: Thursday, June 19, 2014 8:10 PM > Subject: Re: [Tutor] Tips > > On 2014-06-18 18:37, Steven D'Aprano wrote: >> Python tries very hard to ensure that every module is loaded only once. >> (There are circums

Re: [Tutor] Tips

2014-06-19 Thread Steven D'Aprano
On Thu, Jun 19, 2014 at 11:10:26AM -0700, Alex Kleider wrote: > The idea of a singleton class is new to me as is this comparison of > class vs module. > Can anyone suggest a place to turn for more discussion of the topic? > thks, alexK "Singleton" is one of the classic "design patterns", althoug