Re: [Tutor] program code for Python Programming for the Absolute Beginner, 3rd ed.?

2011-08-29 Thread Richard D. Moores
On Mon, Aug 29, 2011 at 00:19, TheIrda wrote: > on the left check the Programming, networking and security and look for your > book. > Click download and you can see the link to the source code and book related > software > > http://www.delmarlearning.com/companions/content/1435455002/downloads/in

Re: [Tutor] One basic question about the Python's PID of Process object.

2011-08-29 Thread Lisi
On Monday 29 August 2011 07:17:51 Han Guanghua wrote: > 2. Second question:  When I changed the os.getpid() to os.getppid() or > self. _pid,  the Python’s interpreter generates some error message like > “Customer object has no attribute ‘_pid’”. > >   I'm very much a beginner myself, but I am sure

[Tutor] Auto-detecting of Python version - wrong!

2011-08-29 Thread Elisha Rosensweig
Hi All, I'm trying to use easy_install on my Mac to get the Python networx package. On my machine I have installed version 2.5 AND 2.6 of Python. However, wehn I try to install this package, I get: easy_install networkx Searching for networkx Reading http://pypi.python.org/simple/networkx/ Readin

Re: [Tutor] Sorting list of tuples in two passes

2011-08-29 Thread Dayo Adewunmi
On 08/29/2011 01:59 AM, Hugo Arts wrote: On Mon, Aug 29, 2011 at 2:19 AM, Dayo Adewunmi wrote: On 08/28/2011 06:23 PM, Hugo Arts wrote: On Sun, Aug 28, 2011 at 6:43 PM, Dayo Adewunmi wrote: Hi I have a list of tuples that each have four elements: [(firstName,lastName,userName,gidNumber),(

[Tutor] Package installation on Mac does not detect newer version of python

2011-08-29 Thread Elisha Rosensweig
Hi All, I'm trying to use easy_install on my Mac to get the Python networx package. On my machine I have installed version 2.5 AND 2.6 of Python. However, wehn I try to install this package, I get: easy_install networkx Searching for networkx Reading http://pypi.python.org/simple/networkx/ Readin

Re: [Tutor] Auto-detecting of Python version - wrong!

2011-08-29 Thread Steven D'Aprano
Elisha Rosensweig wrote: I'm trying to use easy_install on my Mac to get the Python networx package. On my machine I have installed version 2.5 AND 2.6 of Python. However, wehn I try to install this package, I get: Hi Elisha, This list is for beginners trying to learning Python the language,

[Tutor] Intro

2011-08-29 Thread Cranky Frankie
Hi Python tutor listers, as an intro I'll repost what I sent to my Linux groups, since one of their members turned me on to you: Before Borders imploded I'd joined their club so they'd send me 50% coupons now and then. One afternoon last year I was in the store browsing the computer books and th

Re: [Tutor] Intro

2011-08-29 Thread Lisi
Is it just me, or is this a blatant plug for a specific book, and is it therefore Spam? For what it is worth, I hate all those games. Alan seems to use address books (anyhow initially). Now I can see the point in that. Lisi On Monday 29 August 2011 16:26:55 Cranky Frankie wrote: > Hi Python

Re: [Tutor] Intro

2011-08-29 Thread Lisi
On Monday 29 August 2011 16:45:17 Lisi wrote: > Is it just me, or is this a blatant plug for a specific book, and is it > therefore Spam? Given that remark, I ought not to have included the full text in my reply. I apologise to our spam filters. :-( Lisi

Re: [Tutor] Tutor Digest, Vol 90, Issue 97

2011-08-29 Thread Cranky Frankie
Lisi wrote: <> I hope it's just you, because it is not spam. As I said, I read a *lot* of computer books (I'm a database administrator) and this book really stands out. It's so good I'm thinking of seeing if my wife, who knows nothing about programming, would like to read it. I've never felt tha

Re: [Tutor] Intro

2011-08-29 Thread Brett Ritter
On Mon, Aug 29, 2011 at 11:26 AM, Cranky Frankie wrote: > Hi Python tutor listers, as an intro I'll repost what I sent to my > Linux groups, since one of their members turned me on to you: Glad you're so happy with this book...did you have a question for this list? -- Brett Ritter / SwiftOne sw

[Tutor] Personal: Re: Tutor Digest, Vol 90, Issue 97

2011-08-29 Thread python
Hi Frank, Please don't unsubscribe. Book reviews are always welcome. Malcolm ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Intro

2011-08-29 Thread Alan Gauld
On 29/08/11 16:45, Lisi wrote: Is it just me, or is this a blatant plug for a specific book, and is it therefore Spam? I think its intended to be a plug for Python rather than (or as well as) the book :-) For what it is worth, I hate all those games. Alan seems to use address books (anyhow i

Re: [Tutor] Auto-detecting of Python version - wrong!

2011-08-29 Thread Alan Gauld
On 29/08/11 13:54, Steven D'Aprano wrote: (I emphasis that these are guesses... I haven't used Apple Macs regularly since System 7, back when Steve Jobs was still persona non grata at Apple. How times have changed.) Yeah, although I hear that he is leaving Apple(again) although on friendly ter

Re: [Tutor] Intro

2011-08-29 Thread Cranky Frankie
I'm trying to decide what would be better: - reading the huge quote file (hundreds of entries, two strings, author and quotation) in each time the program starts - loading the quotes into an array in the program I'd like to be able to add new quotes easily, so that is a factor as well. I'm sati

Re: [Tutor] Intro

2011-08-29 Thread Joel Goldstick
On Mon, Aug 29, 2011 at 2:29 PM, Cranky Frankie wrote: > I'm trying to decide what would be better: > > - reading the huge quote file (hundreds of entries, two strings, > author and quotation) in each time the program starts > > - loading the quotes into an array in the program > > I'd like to be

Re: [Tutor] Tutor Digest, Vol 90, Issue 97

2011-08-29 Thread Lisi
On Monday 29 August 2011 18:01:44 Cranky Frankie wrote: > I'm sorry you were offended by my posts. If others were as well let me > know and I'll unsubscribe immediately. Post in the singular. I could not, and can not, I'm afraid, see the point in writing such a long panegyric about Python to a l

Re: [Tutor] Intro

2011-08-29 Thread Lisi
On Monday 29 August 2011 19:02:29 Alan Gauld wrote: > To be fair, in the paper edition of my tutor I do use a Games framework > as a second case-study. I then use the framework to build a number > guessing game and a Hangman (and a Mastermind on the CD)... Now, I knew there was a reason I decided

Re: [Tutor] Intro

2011-08-29 Thread Prasad, Ramit
I think I will take a page from rantingrick and state facts without providing any sources to back them up :) >>But statistically women don't like computer games (and yes, I know some do, >>but among women they are statistically in a minority). This has been historically true but women gamers are

Re: [Tutor] Tutor Digest, Vol 90, Issue 98

2011-08-29 Thread Cranky Frankie
Joel Goldstick wrote: <> Just planning it out in my head so far, like pseudocode. I hope to get started soon. I'm just looking to have a little dialog box come up, display a random quote of the day, and then hit enter and it's gone. Should be a nice, simple way to get started with Python. --

Re: [Tutor] Intro

2011-08-29 Thread Emile van Sebille
On 8/29/2011 11:29 AM Cranky Frankie said... I'm trying to decide what would be better: 'better' is subjective. On the one hand, you have a monolithic python program that consolidates data and program into a single source; on the other hand, you have separation of logic and data. Most ofte

[Tutor] Loops and matrices'

2011-08-29 Thread Reed DA (Danny) at Aera
Hi all, I have a matrix which contains temperatures. The columns are time, spaced 33 seconds apart, and the rows are depth intervals. What I'm trying to do is create another matrix that contains the rate of change of temperature for each depth. The array is called LS_JULY_11 and the output arra

Re: [Tutor] Loops and matrices'

2011-08-29 Thread Prasad, Ramit
Hi Danny, Most likely you want     delta_temp(i,j) = (LS_JULY_11(i,j) - LS_JULY_11(i,j-1))/TIME_STEP to become (changed the character from '()' to '[]':     delta_temp[i,j] = (LS_JULY_11(i,j) - LS_JULY_11(i,j-1))/TIME_STEP Basically it t

Re: [Tutor] Loops and matrices'

2011-08-29 Thread Emile van Sebille
On 8/29/2011 3:28 PM Reed DA (Danny) at Aera said... Hi all, I have a matrix which contains temperatures. The columns are time, spaced 33 seconds apart, and the rows are depth intervals. What I'm trying to do is create another matrix that contains the rate of change of temperature for each depth

[Tutor] select particular directories and files

2011-08-29 Thread questions anon
I am trying to select particular files within a particular subdirectory, I have been able to do both but not together! When I try to select my files within the dir loop nothing comes up, but when I leave the files outside the dir loops it selects all the files not just the ones in the dirs I have s

Re: [Tutor] select particular directories and files

2011-08-29 Thread Emile van Sebille
On 8/29/2011 4:52 PM questions anon said... I am trying to select particular files within a particular subdirectory, You might find glob a better starting point: ActivePython 2.6.6.15 (ActiveState Software Inc.) based on Python 2.6.6 (r266:84292, Aug 24 2010, 16:01:11) [MSC v.1500 32 bit (Int

Re: [Tutor] Intro

2011-08-29 Thread Alan Gauld
On 29/08/11 19:29, Cranky Frankie wrote: - reading the huge quote file (hundreds of entries, two strings, author and quotation) in each time the program starts - loading the quotes into an array in the program If you just want a random quote find the size of the file. Generate a random number

[Tutor] 答复: One basic question about the Python's PID of Process object.

2011-08-29 Thread Han Guanghua
Thanks for your help. Now I think I found the reason why os.getpid() returns the same PID value for the Process object, because Process object is NOT the standard Python's process which is adapted by a library called SimPy.(Simulation with Python). BRs, Han / Henrry -邮件原件- 发件人: tutor

Re: [Tutor] Tutor Digest, Vol 90, Issue 98

2011-08-29 Thread Alan Gauld
On 29/08/11 21:08, Cranky Frankie wrote: Please use meaningful subject lines. "Re: Tutor Digest, Vol 90, Issue 98" doesn't help anyone identify a topic in the future and it doesn't help filter messages now. However, on the plus side, thank you for *not* including the whole digest in your messag

Re: [Tutor] Loops and matrices'

2011-08-29 Thread Alan Gauld
On 30/08/11 00:26, Emile van Sebille wrote: delta_temp(i,j) = (LS_JULY_11(i,j) - LS_JULY_11(i,j-1))/TIME_STEP delta_temp access and assignment likely wants to be expressed with brackets rather than parens. And for those not speaking the US variant of English that'll be square brackets as op

Re: [Tutor] Tutor Digest, Vol 90, Issue 97

2011-08-29 Thread Alan Gauld
On 29/08/11 20:23, Lisi wrote: ...I could not, and can not, I'm afraid, see the point in writing such a long panegyric about Python It's actually quite common on this list. Especially from programmers newly come to Python from other languages and who get quite excited when they discover how pow

Re: [Tutor] Loops and matrices'

2011-08-29 Thread Steven D'Aprano
Alan Gauld wrote: On 30/08/11 00:26, Emile van Sebille wrote: delta_temp(i,j) = (LS_JULY_11(i,j) - LS_JULY_11(i,j-1))/TIME_STEP delta_temp access and assignment likely wants to be expressed with brackets rather than parens. And for those not speaking the US variant of English that'll be squ

Re: [Tutor] Tutor Digest, Vol 90, Issue 97

2011-08-29 Thread Steven D'Aprano
Lisi wrote: On Monday 29 August 2011 18:01:44 Cranky Frankie wrote: I'm sorry you were offended by my posts. If others were as well let me know and I'll unsubscribe immediately. Post in the singular. I could not, and can not, I'm afraid, see the point in writing such a long panegyric about P

Re: [Tutor] select particular directories and files

2011-08-29 Thread questions anon
Thanks for responding When I try glob.glob I receive no errors but nothing prints. MainFolder=r"E:/Sample/" for dir in glob.glob(MainFolder + '01'): print "my selected directories are:", dir for ncfile in glob.glob('.nc'): print "my selected netcdf files are:", ncfile

Re: [Tutor] select particular directories and files

2011-08-29 Thread Andre' Walker-Loud
Dear Anonymous Questioner, I am not sure how the Windows environment works, but in linux, I would replace > for ncfile in glob.glob('.nc'): with > for ncfile in glob.glob('*.nc'): ie, add the "wild card" '*' character to grab all files which end in '.nc' Andre On Aug 2

Re: [Tutor] select particular directories and files

2011-08-29 Thread questions anon
thanks, that was an error by me. but that still doesn't help me select the dir and files! Could it be because I am trying to select folders within other folders to then get a file from each of those folders? On Tue, Aug 30, 2011 at 1:30 PM, Andre' Walker-Loud wrote: > Dear Anonymous Questioner,

Re: [Tutor] select particular directories and files

2011-08-29 Thread Andre' Walker-Loud
hello, yes, I would also try adding a wild card in the dir search >> for dir in glob.glob(MainFolder + '01\*'): to check if this is helps, in an interpreter (rather than script) try dirs = glob.glob(MainFolder + '\01\*'): print dirs if you get "[]" then this was not the answer, but if you ge

Re: [Tutor] select particular directories and files

2011-08-29 Thread questions anon
It worked! thank you. This is the code I ended with: for dir in glob.glob(MainFolder + '*/01/'): print dir for ncfile in glob.glob(dir + '*.nc'): print ncfile can you choose more than one folder with glob? i.e. I tried: for dir in glob.glob(MainFolder + '*/01/', '*

Re: [Tutor] select particular directories and files

2011-08-29 Thread Andre' Walker-Loud
to have multiple dirs is simple, > for dir in glob.glob(MainFolder + '*/01/') + glob.glob(MainFolder + '*/02/') > + glob.glob(MainFolder + '*/03/'): there may be a better way, but this should work. By the way, not to discourage you from asking questions on the list, but many of these things

Re: [Tutor] select particular directories and files

2011-08-29 Thread questions anon
ok, thanks for your help Andre On Tue, Aug 30, 2011 at 2:37 PM, Andre' Walker-Loud wrote: > to have multiple dirs is simple, > > for dir in glob.glob(MainFolder + '*/01/') + glob.glob(MainFolder + > '*/02/') + glob.glob(MainFolder + '*/03/'): > > > there may be a better way, but this should work.

Re: [Tutor] select particular directories and files

2011-08-29 Thread Andre' Walker-Loud
Hello anonymous questioner, > ok, thanks for your help Andre your welcome. hope you continue enjoying python. Andre > On Tue, Aug 30, 2011 at 2:37 PM, Andre' Walker-Loud > wrote: > to have multiple dirs is simple, > >> for dir in glob.glob(MainFolder + '*/01/') + glob.glob(MainFolder + '*

Re: [Tutor] Loops and matrices'

2011-08-29 Thread Peter Otten
Reed DA (Danny) at Aera wrote: > I have a matrix which contains temperatures. The columns are time, spaced > 33 seconds apart, and the rows are depth intervals. What I'm trying to do > is create another matrix that contains the rate of change of temperature > for each depth. The array is called LS

Re: [Tutor] select particular directories and files

2011-08-29 Thread Peter Otten
questions anon wrote: > I am trying to select particular files within a particular subdirectory, I > have been able to do both but not together! > When I try to select my files within the dir loop nothing comes up, but > when I leave the files outside the dir loops it selects all the files > not j

Re: [Tutor] Tutor Digest, Vol 90, Issue 97

2011-08-29 Thread Lisi
On Tuesday 30 August 2011 02:21:15 Steven D'Aprano wrote: > Heh, well different people find different approaches useful. To coin a cliché, it would be a dull world if we were all the same. :-) Lisi ___ Tutor maillist - Tutor@python.org To unsubscribe