Re: [Tutor] Unknown Cause of Error

2013-05-10 Thread Alan Gauld
On 11/05/13 07:12, Steven D'Aprano wrote: def menu(): print "Welcome to Tomb Explorer!" print "A game of Exploration from Bulldog Development" print "Press [1] to Play or [2] to Exit" menu1=raw_input(" >> ") if menu1== "2": quit() if menu1== "1": r

Re: [Tutor] Tutor Digest, Vol 111, Issue 24

2013-05-10 Thread Steven D'Aprano
On 11/05/13 06:17, Alan Gauld wrote: Pascal is still case agnostic and in that community its often seen as a benefit since it avoids a whole class of "error" - when you type the case of a word wrongly... Interesting that you say that. Just the other week I was reading a page somewhere talking

Re: [Tutor] range efficiency

2013-05-10 Thread Steven D'Aprano
On 11/05/13 07:19, Jim Mooney wrote: If I'm using a variable-dependent range in a for loop, is Python smart enough to figure the variable once so I don't have to hoist it up? That is for c in range(0,x+2), is x+2 figured once or every time through the loop? I'm assuming it's once but I like to v

Re: [Tutor] Unknown Cause of Error

2013-05-10 Thread Steven D'Aprano
On 11/05/13 12:13, Jack Little wrote: I have a slight problem. My program will not open. What do you mean "open"? How are you trying to open it? What editor are you opening it in? Or do you mean your program will not *run*? How are you trying to run it? On top of that, I have written simi

Re: [Tutor] Unknown Cause of Error

2013-05-10 Thread Amit Saha
On Sat, May 11, 2013 at 12:13 PM, Jack Little wrote: > I have a slight problem. My program will not open. On top of that, I have > written similar programs all to no avail. I am creating a text adventure and > want there to be different rooms. Here is my code: > > > def menu(): > print "Welcom

[Tutor] Unknown Cause of Error

2013-05-10 Thread Jack Little
I have a slight problem. My program will not open. On top of that, I have written similar programs all to no avail. I am creating a text adventure and want there to be different rooms. Here is my code: def menu():     print "Welcome to Tomb Explorer!"     print "A game of Exploration from Bull

Re: [Tutor] range efficiency

2013-05-10 Thread Prasad, Ramit
Jim Mooney wrote: > If I'm using a variable-dependent range in a for loop, is Python smart > enough to figure the variable once so I don't have to hoist it up? > > That is for c in range(0,x+2), is x+2 figured once or every time > through the loop? I'm assuming it's once but I like to verify. > >

Re: [Tutor] range efficiency

2013-05-10 Thread Dave Angel
On 05/10/2013 05:19 PM, Jim Mooney wrote: If I'm using a variable-dependent range in a for loop, is Python smart enough to figure the variable once so I don't have to hoist it up? That is for c in range(0,x+2), is x+2 figured once or every time through the loop? I'm assuming it's once but I like

[Tutor] range efficiency

2013-05-10 Thread Jim Mooney
If I'm using a variable-dependent range in a for loop, is Python smart enough to figure the variable once so I don't have to hoist it up? That is for c in range(0,x+2), is x+2 figured once or every time through the loop? I'm assuming it's once but I like to verify. I'll figure this myself once I

Re: [Tutor] Tutor Digest, Vol 111, Issue 24

2013-05-10 Thread Alan Gauld
On 10/05/13 20:02, Jim Mooney wrote: As regards camelCaps, all I see in the Py Lib is underlines, so I guess that's more of a convention and I might as well stick to it, Yep. I think both camelCaps and underlines are often artifacts having to use short names years ago. Not so much short na

Re: [Tutor] Tutor Digest, Vol 111, Issue 24

2013-05-10 Thread Jim Mooney
>> BTW, does your "better name" mean that camelCaps are discouraged in >> Python? > > No, although most Python modules are all lowercase. But I really meant that > your module should be for more than just making lists, it should eventually > have all the functions needed to manage the list. > > Eve

Re: [Tutor] Python debugger/IDE that can be launched from a remote command line

2013-05-10 Thread Abhishek Pratap
On Fri, May 10, 2013 at 10:58 AM, Michael O'Leary wrote: > I am working on a project in which the code and data I am working with are > all on an Amazon EC2 machine. So far I have been ssh'ing to the EC2 machine > in two terminal windows, running emacs or vi in one of them to view and > update the

[Tutor] Python debugger/IDE that can be launched from a remote command line

2013-05-10 Thread Michael O'Leary
I am working on a project in which the code and data I am working with are all on an Amazon EC2 machine. So far I have been ssh'ing to the EC2 machine in two terminal windows, running emacs or vi in one of them to view and update the code and running the "python -m pdb ..." debugger in the other on

Re: [Tutor] Tutor Digest, Vol 111, Issue 24

2013-05-10 Thread Jim Mooney
> As with any other module you need to specify the module when using its > contents: > > newRandomList = makeRandomList.createRandomList() > > BTW. A better name for the module is probably just randomlist > > HTH > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ Ah

Re: [Tutor] MutableString/Class variables

2013-05-10 Thread Albert-Jan Roskam
> From: Steven D'Aprano > To: tutor@python.org > Cc: > Sent: Friday, May 10, 2013 1:28 PM > Subject: Re: [Tutor] MutableString/Class variables > > On 09/05/13 22:10, Albert-Jan Roskam wrote: >> Hello, >> >> I was just playing a bit with Python and I wanted to make a mutable string, > that

Re: [Tutor] MutableString/Class variables

2013-05-10 Thread Steven D'Aprano
On 09/05/13 22:10, Albert-Jan Roskam wrote: Hello, I was just playing a bit with Python and I wanted to make a mutable string, that supports item assignment. Is the way below the way to do this? Guido's time machine strikes again: py> from UserString import MutableString py> s = MutableStri

Re: [Tutor] PyScripter header?

2013-05-10 Thread Albert-Jan Roskam
> Sent: Wednesday, May 8, 2013 1:38 PM > Subject: Re: [Tutor] PyScripter header? > > El 08/05/13 05:10, Jim Mooney escribió: >> >> PyScripter has enough extra features, that I'll probably switch to it. >> But has anyone found any odd problems with it? Tks. >> >> Jim >> > > Given that you

Re: [Tutor] MutableString/Class variables

2013-05-10 Thread Albert-Jan Roskam
>Subject: Re: [Tutor] MutableString/Class variables >On 05/09/2013 09:16 AM, Albert-Jan Roskam wrote: >>> On 05/09/2013 08:10 AM, Albert-Jan Roskam wrote:    Hello,    I was just playing a bit with Python and I wanted to make a mutable string, >>> that supports item assignment. I

Re: [Tutor] bad name in module

2013-05-10 Thread Dave Angel
On 05/10/2013 01:45 AM, Jim Mooney wrote: I have a simple program, below, to create a specified list of random integers, which works fine. I saved it to Lib as makeRandomList.py, then imported it to a sorter.py program, like so. The import doesn't fail: import makeRandomList newRandomList = cre