Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-10-01 Thread Oscar Benjamin
On Oct 1, 2012 12:26 AM, "Alan Gauld" wrote: > > On 30/09/12 11:50, Oscar Benjamin wrote: >> While I can write a script like the OP's in less than 5 minutes, in >> practise it takes longer to convince myself that the code is correct (if >> it is important for it to be so). I spend most of the time

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-01 Thread Oscar Benjamin
On Sep 30, 2012 11:10 PM, "Cecilia Chavana-Bryant" wrote: > > Hola again Python Tutor! Hi Cecilia > > With a friend's help I have the following code to extract reflectance data > from an ASCII data file, do a bit of data manipulation to calibrate the data > and then write the calibrated file i

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-10-01 Thread Alan Gauld
On 01/10/12 09:52, Oscar Benjamin wrote: I guess we won't get to find out but I assumed that the OP understood what he was doing mathematically but was struggling with the Python In retrospect I think that's true. When I posted my original reply I assumed he was new to Python and learning abo

Re: [Tutor] generic repr method?

2012-10-01 Thread Albert-Jan Roskam
- Original Message - > From: eryksun > To: Albert-Jan Roskam > Cc: Python Mailing List > Sent: Sunday, September 30, 2012 1:46 AM > Subject: Re: [Tutor] generic repr method? > > On Sat, Sep 29, 2012 at 4:15 PM, Albert-Jan Roskam > wrote: >> >>     def __repr__(self): >>        

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-10-01 Thread Albert-Jan Roskam
- Original Message - > From: Alan Gauld > To: tutor@python.org > Cc: > Sent: Sunday, September 30, 2012 10:22 AM > Subject: Re: [Tutor] Lotka-Volterra Model Simulation Questions > > On 30/09/12 00:09, Brett Ritter wrote: > >> agreement.  Can you point to any of the research you ment

Re: [Tutor] OT: Netiquette

2012-10-01 Thread Emile van Sebille
On 9/30/2012 6:16 PM, Dwight Hutto wrote: But he started it. Now be the man and end it. Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] generic repr method?

2012-10-01 Thread eryksun
On Mon, Oct 1, 2012 at 8:16 AM, Albert-Jan Roskam wrote: > >I had not considered __slots__ at all. I have read about it; IIRC they >can be uised to "slim down" a class so it uses less memory. Is it true >that this is not used very often? In a class defined with __slots__, it's up to you whether t

Re: [Tutor] generic repr method?

2012-10-01 Thread Oscar Benjamin
On 1 October 2012 13:16, Albert-Jan Roskam wrote: > >> On Sat, Sep 29, 2012 at 4:15 PM, Albert-Jan Roskam >> wrote: >>> >>> def __repr__(self): >>> code = self.__class__.__name__ + "(" >>> for arg in inspect.getargspec(self.__init__).args [1:] : >>> if isinsta

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-01 Thread Cecilia Chavana-Bryant
On Mon, Oct 1, 2012 at 12:33 AM, Alan Gauld wrote: > On 30/09/12 23:07, Cecilia Chavana-Bryant wrote: > >> Hola again Python Tutor! >> >> With a friend's help I have the following code to extract reflectance >> data from an ASCII data file, do a bit of data manipulation to calibrate >> the data an

Re: [Tutor] Help for Python Beginner with extracting and manipulating data from thousands of ASCII files

2012-10-01 Thread Cecilia Chavana-Bryant
On Mon, Oct 1, 2012 at 1:16 AM, Dave Angel wrote: > On 09/30/2012 06:07 PM, Cecilia Chavana-Bryant wrote: > > Hola again Python Tutor! > > > > With a friend's help I have the following code to extract reflectance > data > > from an ASCII data file, do a bit of data manipulation to calibrate the >

Re: [Tutor] html checker

2012-10-01 Thread bob gailer
On 10/1/2012 11:45 AM, Matthew Dalrymple wrote: Im trying to write an html syntax checker...pretty much read an imported file, if it has all the opening and closing "<" and ">" it will return True and if it doesn't it will return False. this is what i have so far http://pastie.org/4891833 how

Re: [Tutor] html checker

2012-10-01 Thread Matthew Dalrymple
I don't need to hear how bad my programs are...either you are gonna help or your not...if you have questions about what i have wrote or why i wrote something someway ask...dont just jump to conclusions I forgot to include that i had to write a "stack" function in a "pythonbasic" file to import

Re: [Tutor] html checker

2012-10-01 Thread Andre' Walker-Loud
Dear Matthew, > I don't need to hear how bad my programs are...either you are gonna help or > your not...if you have questions about what i have wrote or why i wrote > something someway ask...dont just jump to conclusions > > I forgot to include that i had to write a "stack" function in a "pyt

Re: [Tutor] html checker

2012-10-01 Thread c smith
You will not find much help in getting a program to 'just work' regardless of your own experience. My advice would be to try and run small parts at a time to pinpoint where the problem is. Are you opening and reading the file properly? Are you iterating over the read file properly? Does your html c

Re: [Tutor] html checker

2012-10-01 Thread Brian van den Broek
On 1 Oct 2012 15:28, "Matthew Dalrymple" wrote: > > I don't need to hear how bad my programs are...either you are gonna help or your not...if Matthew, Bob didn't cuddle you and he may have been a bit more brusque than you'd have liked. However, his response to you was intended as help, it provid

Re: [Tutor] html checker

2012-10-01 Thread Matthew Dalrymple
> Subject: Re: [Tutor] html checker > From: walksl...@gmail.com > Date: Mon, 1 Oct 2012 12:38:07 -0700 > CC: tutor@python.org > To: computer_dud...@hotmail.com > > Dear Matthew, > > > I don't need to hear how bad my programs are...either you are gonna help or > > your not...if you have questi

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-10-01 Thread Brian van den Broek
On 30 September 2012 04:37, Alan Gauld wrote: > > One of the things that makes math hard for people to grasp is its insistence > on abstracting functions/values to single letter names etc. (especially when > those names are in a foreign language/symbology, > like Greek!) Of course, the abstracti

Re: [Tutor] html checker

2012-10-01 Thread c smith
yourlisthere.pop() will return the last element in the list and change the list so it no longer contains the element. yourlisthere.push(x) will add x to the end of the list. Works on more than just lists ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] html checker

2012-10-01 Thread Joel Goldstick
> i don't really understand the pop and push or even stacks for that > matter...the professor i have isn't really the best at teaching...so if > anyone could give me a hand with any of this that would be appreciated The way I was taught about pop and push: Think of a stack of dishes. Each time y

Re: [Tutor] html checker

2012-10-01 Thread eryksun
On Mon, Oct 1, 2012 at 11:45 AM, Matthew Dalrymple wrote: > > Im trying to write an html syntax checker...pretty much read an imported > file, if it has all the opening and closing "<" and ">" it will return True > and if it doesn't it will return False. It's just this htmlChecker function that y

Re: [Tutor] html checker

2012-10-01 Thread eryksun
On Mon, Oct 1, 2012 at 4:23 PM, eryksun wrote: > > Finally: > > > print(s1) > > > If s1 is an iterable sequence, you can print the string using either > "print(''.join(s1))" or "print(*s1, sep='')". Also, at this point > should s1 be emptied? Sorry, that last statement was wrong. I was th

[Tutor] 1d to 2d array creation

2012-10-01 Thread Bala subramanian
Friends, I have an 1d array like a=[1, 1, 2, 2, 2, 3, 3, 1, 1, 1], i have to convert it to 2d array for plotting as follows. The 2d array is filled by a[colum index] to obtain the new array shown below. [ [ 1., 1., 0., 0., 0., 0., 0., 1., 1., 1.], [ 0., 0., 2., 2., 2., 0., 0., 0.

Re: [Tutor] 1d to 2d array creation

2012-10-01 Thread Oscar Benjamin
On 1 October 2012 22:04, Bala subramanian wrote: > Friends, > I have an 1d array like a=[1, 1, 2, 2, 2, 3, 3, 1, 1, 1], i have to > convert it to 2d array for plotting as follows. The 2d array is filled > by a[colum index] to obtain the new array shown below. > > [ [ 1., 1., 0., 0., 0., 0.,

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-10-01 Thread Alan Gauld
On 01/10/12 21:05, Brian van den Broek wrote: On 30 September 2012 04:37, Alan Gauld wrote: like Greek!) Of course, the abstraction is powerful in its own right because it can then be applied in multiple domains, but that abstraction is often the barrier to people understanding the principle.

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-10-01 Thread Brian van den Broek
On 1 October 2012 19:30, Alan Gauld wrote: > translation for them, not just complain of their 'ignorance'. But that's now > taking things way, way off topic!! :-) I think you meant ``way^2 off topic'' ;-) Brian vdB ___ Tutor maillist - Tutor@python

Re: [Tutor] html checker

2012-10-01 Thread Alan Gauld
On 01/10/12 20:59, Matthew Dalrymple wrote: i don't really understand the pop and push or even stacks for that matter...the professor i have isn't really the best at teaching...so if anyone could give me a hand with any of this that would be appreciated The Raw materials topic in my tutor has

[Tutor] HELP!

2012-10-01 Thread Mark Rourke
hello, I am a college student in my first year of computer programming, I was wondering if you could look at my code to see whats wrong with it. # Mark Rourke # Sept 29, 2012 # Write a program to calculate the sales tax at the rate of 4% and 2% respectively # Thereafter compute the total sales

Re: [Tutor] HELP!

2012-10-01 Thread c smith
Is the only problem that your code is giving unexpected results, or that it doesnt run or what? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python help?

2012-10-01 Thread c smith
It is hard to see things like images and attachments. I think purely html is preferred, but i would have to look over 'the list rules' again. You should look into dictionaries as the structure to hold your info. ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] html checker

2012-10-01 Thread eryksun
On Mon, Oct 1, 2012 at 7:46 PM, Alan Gauld wrote: > > As c smith points out, Python lists have a pop/push mechanism as standard > which makes implementing a stack in Python fairly trivial. > > To expand on how reversing works consider pushing the string foo onto the > stack then popping it off aga

Re: [Tutor] python help?

2012-10-01 Thread Dave Angel
On 10/01/2012 08:16 PM, c smith wrote: > It is hard to see things like images and attachments. I think purely html > is preferred, but i would have to look over 'the list rules' again. Since this is a text mailing-list, it's text messages that are preferred. html messages frequently trash indenta

[Tutor] Civil discourse from a newbie's perspective

2012-10-01 Thread boB Stepp
I have been following the discussions here since middle-May of this year. I have gathered that the volunteers strongly value precision of speech and proper formatting of posts and especially making a strong effort to solve one's problem(s) before bringing it(them) up here for help. I think I unders

Re: [Tutor] python help?

2012-10-01 Thread Dave Angel
On 09/30/2012 02:02 AM, patrick Howard wrote: > I have to write a program that takes an input file, with students names and > various grades. > My vindictive teacher also added grades that are not supposed to count, so I > need to pick the grades that are 'HM1-4"; not HW, or TEST or anything else

Re: [Tutor] what's wrong with my code? (was HELP!)

2012-10-01 Thread bob gailer
On 9/30/2012 3:31 PM, Mark Rourke wrote: hello, I am a college student in my first year of computer programming, I was wondering if you could look at my code to see whats wrong with it. Welcome to the tutor list. I assume this is your first visit. Why? because we always request that you tell us

Re: [Tutor] python help?

2012-10-01 Thread Dave Angel
On 10/01/2012 09:44 PM, Dave Angel wrote: > On 09/30/2012 02:02 AM, patrick Howard wrote: >> I have to write a program that takes an input file, with students names and >> various grades. >> My vindictive teacher also added grades that are not supposed to count, so I >> need to pick the grades th

Re: [Tutor] HELP!

2012-10-01 Thread Brian van den Broek
On 1 Oct 2012 19:58, "Mark Rourke" wrote: > > hello, I am a college student in my first year of computer programming, I was > wondering if you could look at my code to see whats wrong with it. > > # Mark Rourke > # Sept 29, 2012 > # Write a program to calculate the sales tax at the rate of 4% and

Re: [Tutor] Civil discourse from a newbie's perspective

2012-10-01 Thread Steven D'Aprano
On Mon, Oct 01, 2012 at 08:34:03PM -0500, boB Stepp wrote: > I have been following the discussions here since middle-May of this > year. I have gathered that the volunteers strongly value precision of > speech and proper formatting of posts Some more than others, but yes. > and especially makin