Re: [Tutor] making a random list, then naming it

2013-05-23 Thread Dave Angel
On 05/23/2013 10:39 PM, Jim Mooney wrote: I keep needing random lists of integers for trying things, so I wrote a small prog I'll import as randlist. The user enters the length and max val, but then I want the actual data name of the random list created, to be list_(length entered)_(max value e

Re: [Tutor] Difference between types

2013-05-23 Thread Steven D'Aprano
On 24/05/13 05:57, Citizen Kant wrote: I guess I'm understanding that, in Python, if something belongs to a type, must also be a value. Everything in Python is a value, and everything belongs to a type. Including other types. Yes, types are values too, and types have types of their own. There

[Tutor] making a random list, then naming it

2013-05-23 Thread Jim Mooney
I keep needing random lists of integers for trying things, so I wrote a small prog I'll import as randlist. The user enters the length and max val, but then I want the actual data name of the random list created, to be list_(length entered)_(max value entered) as an easy mnemonic. I got as far

Re: [Tutor] Difference between types

2013-05-23 Thread Dave Angel
On 05/23/2013 03:57 PM, Citizen Kant wrote: It's quite hard to believe that you're not just trolling. Little that you say below makes any sense with regards to Python. I guess I'm understanding that, in Python, if something belongs to a type, must also be a value. Nothing belongs to a ty

Re: [Tutor] keyboard interrupt

2013-05-23 Thread Steven D'Aprano
On 24/05/13 06:37, Jim Mooney wrote: Apparently Wing isn't as savvy as IDLE when it comes to communicating with the subprocess. I've only searched for about a minute, but apparently the way this works in Wing is to "Restart Shell": http://stackoverflow.com/a/10360503/205580 http://www.wingware.c

Re: [Tutor] keyboard interrupt

2013-05-23 Thread Jim Mooney
> Apparently Wing isn't as savvy as IDLE when it comes to communicating > with the subprocess. I've only searched for about a minute, but > apparently the way this works in Wing is to "Restart Shell": > > http://stackoverflow.com/a/10360503/205580 > http://www.wingware.com/doc/debug/interactive-pyt

Re: [Tutor] Difference between types

2013-05-23 Thread boB Stepp
On Thu, May 23, 2013 at 2:57 PM, Citizen Kant wrote: > I guess I'm understanding that, in Python, if something belongs to a type, > must also be a value. > > I guess I'm understanding that the reason why 9 is considered a value, is > since it's a normal form, an element of the system that cannot b

Re: [Tutor] Difference between types

2013-05-23 Thread Matthew Ngaha
wait for someone more knowledgeable to answer, but from what i know, Yes it does have a profound meaning. Strings consist of character sets. Something that was here way before Python Like i said my experience is limited so i too would like to hear some reponses ___

[Tutor] Difference between types

2013-05-23 Thread Citizen Kant
I guess I'm understanding that, in Python, if something belongs to a type, must also be a value. I guess I'm understanding that the reason why 9 is considered a value, is since it's a normal form*,* an element of the system that cannot be rewritten and reduced any further. I also guess I'm unders

Re: [Tutor] Presenting text in different ways by using quotes!

2013-05-23 Thread boB Stepp
On Thu, May 23, 2013 at 12:31 PM, Andrew Triplett wrote: > I am asked to present text in different ways by using quotes in strings. for > example: > [...] > I can't however seem to input the text GAME OVER in giant text as it says in > the book. Any help for this would be appreciated. > I'm taki

[Tutor] Fwd: Available characters

2013-05-23 Thread Citizen Kant
Thanks! There are only 127 ASCII characters, so getting a list of them is trivial: ascii = map(chr, range(128)) # Python 2 ascii = list(map(chr, range(128))) # Python 3 or if you prefer a string: ascii = ''.join(map(chr, range(128))) If you don't like map(), you can use a list comprehensio

Re: [Tutor] Presenting text in different ways by using quotes!

2013-05-23 Thread Dave Angel
On 05/23/2013 01:31 PM, Andrew Triplett wrote: I am asked to present text in different ways by using quotes in strings. for example: print("Program "Game Over" 2.0") syntax error. If you need quotes inside quotes, you probably want to use single-quotes for one type. For example, print('P

[Tutor] Presenting text in different ways by using quotes!

2013-05-23 Thread Andrew Triplett
I am asked to present text in different ways by using quotes in strings. for example: print("Program "Game Over" 2.0") print("same", "message", "as before") print("just",    "a bit",     "bigger") print("Here", end=" ") print("it is...") print(   """     """ ) I ca

[Tutor] installing old versions of python on Mac OS X

2013-05-23 Thread Robert R
Hi, I have Mac OS X 10.7.5 and would like to install < = python 2.3 on it. I need it as one of the s/w I would like to try is based on an older version and does not seem to work with the new ones. I am not sure if the s/w is wrong (doesn't seem like it) or is it really the python version that i

Re: [Tutor] try..except - what about that ton of **Error statements?

2013-05-23 Thread boB Stepp
On Wed, May 22, 2013 at 8:47 PM, Steven D'Aprano wrote: > On 23/05/13 02:09, boB Stepp wrote: > >> I would like to ask some general questions here. Problems can arise >> from bugs in the operating system, bugs in the programming language(s) >> being used, bugs in packages/modules being used, bugs

Re: [Tutor] keyboard interrupt

2013-05-23 Thread Jerry Hill
On Wed, May 22, 2013 at 9:25 PM, Dave Angel wrote: > On 05/22/2013 04:11 PM, Jerry Hill wrote: > >> The KeyboardInterrupt ​exception is raised when someone presses Ctrl-C. >> If >> you catch it, and ignore it (which is what your code above is doing), then >> pressing Ctrl-C doesn't do anything.

Re: [Tutor] trying to split or rpartition the contents of a list

2013-05-23 Thread Amit Saha
Hi Stuart, On Thu, May 23, 2013 at 10:57 PM, Stuart Tozer wrote: > Hello Amit- your solution works very well. Thanks very much! Good to know that! Hope it was clear. All the best. -Amit > > Best regards, > Stu > > > On Wed, May 22, 2013 at 11:39 AM, Stuart Tozer wrote: >> >> Thanks very much

Re: [Tutor] trying to split or rpartition the contents of a list

2013-05-23 Thread Stuart Tozer
Hello Amit- your solution works very well. Thanks very much! Best regards, Stu On Wed, May 22, 2013 at 11:39 AM, Stuart Tozer wrote: > Thanks very much guys- I'll get back to this when I have a spare moment > and let you know how I get on. > > Cheers, > Stu > > > > On Wed, May 22, 2013 at 11:0