Re: [Tutor] hi

2013-08-22 Thread Oscar Benjamin
On 20 August 2013 13:49, Vick wrote: > > From: Oscar Benjamin [mailto:oscar.j.benja...@gmail.com] > >> Well just send me some tutorial on how to build and obtain the >> coefficients for the butcher tableau for the RK4 as an example, and >> after I've mastered it, I'd give the dopri8 a shot. > > I

[Tutor] global variables

2013-08-22 Thread Matthew Ngaha
I'm always told to avoid using them. I read discussions on the python irc channel about them but honestly i feel there are some times where i can't avoid using them. Like where i want to keep track of a state variable in many different functions that may or may not alter its value and also not want

Re: [Tutor] global variables

2013-08-22 Thread Chris Down
On 2013-08-22 13:36, Matthew Ngaha wrote: > I'm always told to avoid using them. I read discussions on the python > irc channel about them but honestly i feel there are some times where > i can't avoid using them. Like where i want to keep track of a state > variable in many different functions tha

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 1:40 PM, Chris Down wrote: > It sounds like you want to use a class. > Why would you not just use a class if you want to store state? I don't feel my program needs a class. Also i have been told to stop using classes by some very experienced Python programmers on irc even

Re: [Tutor] global variables

2013-08-22 Thread Chris Down
On 2013-08-22 14:43, Matthew Ngaha wrote: > I don't feel my program needs a class. Also i have been told to stop > using classes by some very experienced Python programmers on irc even > though i don't see why. It's confusing being told different things. Well, if you want to store state, you shoul

Re: [Tutor] global variables

2013-08-22 Thread Alan Gauld
On 22/08/13 13:36, Matthew Ngaha wrote: I'm always told to avoid using them. Global variables in themselves are not the problem. It's how they tend to get used that causes problems. Read-only global values - aka constants (so not really variables!) - are not an issue. Globals that are only ch

Re: [Tutor] global variables

2013-08-22 Thread Alan Gauld
On 22/08/13 14:43, Matthew Ngaha wrote: On Thu, Aug 22, 2013 at 1:40 PM, Chris Down wrote: It sounds like you want to use a class. Why would you not just use a class if you want to store state? Local coding conventions or programmer skill levels may preclude it. I don't feel my program need

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 2:52 PM, Chris Down wrote: >I would doubt that anyone has told you "don't ever use classes", because > that's nonsense; you've probably misread a dissuasion from that path in a > single instance as applying more broadly than was intended. I am being totally honest here. I

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 3:04 PM, Alan Gauld wrote: > On 22/08/13 13:36, Matthew Ngaha wrote: > Global variables in themselves are not the problem. > It's how they tend to get used that causes problems. > Globals that are only changed via a set of > dedicated functions are not topo much of a > p

Re: [Tutor] global variables

2013-08-22 Thread Chris Down
On 2013-08-22 15:12, Matthew Ngaha wrote: > I am being totally honest here. I was very confused at the time and i said i > didn't agree because it's what i had put so much effort into learning. They > went on to say at some well known Python talks speakers have stated why using > OOP (especially in

Re: [Tutor] global variables

2013-08-22 Thread Joel Goldstick
On Thu, Aug 22, 2013 at 10:12 AM, Matthew Ngaha wrote: > On Thu, Aug 22, 2013 at 2:52 PM, Chris Down wrote: >>I would doubt that anyone has told you "don't ever use classes", because >> that's nonsense; you've probably misread a dissuasion from that path in a >> single instance as applying more b

Re: [Tutor] global variables

2013-08-22 Thread Andy McKenzie
On Thu, Aug 22, 2013 at 10:12 AM, Matthew Ngaha wrote: > On Thu, Aug 22, 2013 at 2:52 PM, Chris Down wrote: > >I would doubt that anyone has told you "don't ever use classes", because > > that's nonsense; you've probably misread a dissuasion from that path in a > > single instance as applying mo

Re: [Tutor] global variables

2013-08-22 Thread Steven D'Aprano
On 22/08/13 23:43, Matthew Ngaha wrote: On Thu, Aug 22, 2013 at 1:40 PM, Chris Down wrote: It sounds like you want to use a class. Why would you not just use a class if you want to store state? I don't feel my program needs a class. Also i have been told to stop using classes by some very ex

Re: [Tutor] global variables

2013-08-22 Thread Steven D'Aprano
On 22/08/13 22:36, Matthew Ngaha wrote: I'm always told to avoid using them. I read discussions on the python irc channel about them but honestly i feel there are some times where i can't avoid using them. Like where i want to keep track of a state variable in many different functions that may or

Re: [Tutor] global variables

2013-08-22 Thread Steven D'Aprano
On 22/08/13 22:36, Matthew Ngaha wrote: My question is how many global variables did your last decent sized program have? Also please share any insight you have about them. I do try to avoid them, but is this always possible? Eiffel is another language that aims to eliminate global variables e

Re: [Tutor] global variables

2013-08-22 Thread Steven D'Aprano
On 22/08/13 23:52, Chris Down wrote: On 2013-08-22 14:43, Matthew Ngaha wrote: I don't feel my program needs a class. Also i have been told to stop using classes by some very experienced Python programmers on irc even though i don't see why. It's confusing being told different things. Well, if

Re: [Tutor] global variables

2013-08-22 Thread Steven D'Aprano
On 23/08/13 00:12, Matthew Ngaha wrote: On Thu, Aug 22, 2013 at 2:52 PM, Chris Down wrote: I would doubt that anyone has told you "don't ever use classes", because that's nonsense; you've probably misread a dissuasion from that path in a single instance as applying more broadly than was intende

Re: [Tutor] global variables

2013-08-22 Thread Steven D'Aprano
On 23/08/13 00:59, Andy McKenzie wrote: Isn't object orientation kind of the whole POINT of Python? From python.org: "Python is an interpreted, object-oriented, high-level programming language with dynamic semantics." Well, yes and no. Python is an object-oriented language in the sense that

Re: [Tutor] global variables

2013-08-22 Thread Matthew Ngaha
On Thu, Aug 22, 2013 at 4:35 PM, Steven D'Aprano wrote: > Good question! And one that needs a long answer. Hey i just checked mail again... A big thank you for your responses, i will read all of them now.. im pretty my programs/designs will be much cleaner by the time i done. And yes i was talki

[Tutor] How much in a "try" block?

2013-08-22 Thread leam hall
If I have a series of tasks that depend on X happening, should I put them all in the same "try" block or just put X in there and exit out if it fails? Thanks! Leam -- Mind on a Mission ___ Tutor maillist - Tutor@pyth

Re: [Tutor] How much in a "try" block?

2013-08-22 Thread Amit Saha
On Fri, Aug 23, 2013 at 6:14 AM, leam hall wrote: > If I have a series of tasks that depend on X happening, should I put them > all in the same "try" block or just put X in there and exit out if it fails? You are right about the latter. You should put only the statement which you expect to raise

Re: [Tutor] How much in a "try" block?

2013-08-22 Thread Chris Down
On 2013-08-23 06:20, Amit Saha wrote: > On Fri, Aug 23, 2013 at 6:14 AM, leam hall wrote: > > If I have a series of tasks that depend on X happening, should I put them > > all in the same "try" block or just put X in there and exit out if it fails? > > You are right about the latter. You should p

Re: [Tutor] global variables

2013-08-22 Thread wolfrage8...@gmail.com
Steve, Thanks for all of this information. It seems the OP has sparked the kind of discussion that I had hopped for when I posted http://thread.gmane.org/gmane.comp.python.tutor/83251 Luckily though I did get an excellent response from Alan. http://thread.gmane.org/gmane.comp.python.tutor/83251/

Re: [Tutor] How much in a "try" block?

2013-08-22 Thread Alan Gauld
On 22/08/13 21:27, Chris Down wrote: You can also use the "else" clause if there is stuff you want to run if the try block doesn't raise the caught exception, which avoids putting it in "try" if you don't intend to exit from the exception. I admit that I've never really found a use for else in

Re: [Tutor] How much in a "try" block?

2013-08-22 Thread Amit Saha
On Fri, Aug 23, 2013 at 10:30 AM, Alan Gauld wrote: > On 22/08/13 21:27, Chris Down wrote: > >> You can also use the "else" clause if there is stuff you want to run if >> the try >> block doesn't raise the caught exception, which avoids putting it in "try" >> if >> you don't intend to exit from th

Re: [Tutor] How much in a "try" block?

2013-08-22 Thread Oladipupo Elegbede
Depending on what x is and also whether or not you've decided to go the 'try'route, if, else may be useful from the way you sound. My thought. On 22 Aug 2013 21:16, "leam hall" wrote: > If I have a series of tasks that depend on X happening, should I put them > all in the same "try" block or just

Re: [Tutor] How much in a "try" block?

2013-08-22 Thread Steven D'Aprano
On 23/08/13 10:30, Alan Gauld wrote: I admit that I've never really found a use for else in a try block. I don;t see much advantage in try: f(x) except MyError: pass else: g(x) h(x) over try: f(x) except MyError: pass g(x) h(x) Unless you really only want g(x) executed if the

[Tutor] How to present python experience (self-taught) to potential employer

2013-08-22 Thread Jing Ai
Hi everyone, This is Jing and I am a recent college graduate with Biology and Public Health background. I'm currently learning python on my own when i have time off from my PH internship. There's a job posting that looks really idea for me in the near future (a PH Research position) that requires

Re: [Tutor] python tutoring

2013-08-22 Thread Jing Ai
Hi Trent, I was once wondering about the similar question, but I discovered that Python has a huge user group (stationed across the world) and here's a site that includes the local links to all the user groups around the world, South Korea is included! You can probably find help locally from there

Re: [Tutor] How to present python experience (self-taught) to potential employer

2013-08-22 Thread Amit Saha
Hi Jing Ai, On Fri, Aug 23, 2013 at 12:45 PM, Jing Ai wrote: > Hi everyone, > This is Jing and I am a recent college graduate with Biology and Public > Health background. I'm currently learning python on my own when i have time > off from my PH internship. There's a job posting that looks reall

Re: [Tutor] How to present python experience (self-taught) to potential employer

2013-08-22 Thread Amit Saha
On Fri, Aug 23, 2013 at 1:52 PM, Jing Ai wrote: > @Amit > Thank you for your suggestions! I'll look into the data there and see if > there's something relevant that I can use to do a project. Yes I believe it > would involve some data analysis (and I may need to learn R as well or use > RPy). D

Re: [Tutor] How to present python experience (self-taught) to potential employer

2013-08-22 Thread Jing Ai
@Amit Thank you for your suggestions! I'll look into the data there and see if there's something relevant that I can use to do a project. Yes I believe it would involve some data analysis (and I may need to learn R as well or use RPy). Do you think one project is sufficient to demonstrate my ski