Re: [Tutor] problem with simple script

2010-08-01 Thread Richard D. Moores
(This repeats an earlier post of mine, and gives the correct link to the script I wrote about: . In a subsequent post I reported that I had gotten rid of the flag in a further revision: This link is correct. I apologize

Re: [Tutor] problem with simple script

2010-07-31 Thread Richard D. Moores
On Thu, Jul 29, 2010 at 12:22, Richard D. Moores wrote: > On Wed, Jul 28, 2010 at 08:35, Richard D. Moores wrote: > > Here's my slight revision of Steven's script (see my note, lines 9-14) > -- revised only because I wanted it to handle the case where the user > (me) entered the interval bounds i

Re: [Tutor] problem with simple script

2010-07-29 Thread Richard D. Moores
On Wed, Jul 28, 2010 at 08:35, Richard D. Moores wrote: > Now I'll dig into all the help I received. I see an *args in Steven's > detailed reply. That'll take some reviewing to understand. Here's my slight revision of Steven's script (see my note, lines 9-14) -- revised only because I wanted it

Re: [Tutor] problem with simple script

2010-07-28 Thread Richard D. Moores
On Wed, Jul 28, 2010 at 04:51, Richard D. Moores wrote: > I have a practical need for a script that will give me a random int in the > closed interval [n, m]. Please see . > > This works fine when I enter both n and m as, for example, "23, 56", or even > "56,

Re: [Tutor] problem with simple script

2010-07-28 Thread Steven D'Aprano
On Wed, 28 Jul 2010 09:51:40 pm Richard D. Moores wrote: > I have a practical need for a script that will give me a random int > in the closed interval [n, m]. Please see > . What is the purpose of this function? def get_random_int(n, m): return randint(

Re: [Tutor] problem with simple script

2010-07-28 Thread Nick Raptis
On 07/28/2010 02:51 PM, Richard D. Moores wrote: I have a practical need for a script that will give me a random int in the closed interval [n, m]. Please see . This works fine when I enter both n and m as, for example, "23, 56", or even "56, 23". But of

Re: [Tutor] problem with simple script

2010-07-28 Thread Luke Paireepinart
Just do a split of the input from the user on space or comma. If Len() of the split data is 1, do your [1, ...] interval, otherwise do the other interval. Sent from my iPhone On Jul 28, 2010, at 6:51 AM, "Richard D. Moores" wrote: > I have a practical need for a script that will give me a rand

[Tutor] problem with simple script

2010-07-28 Thread Richard D. Moores
I have a practical need for a script that will give me a random int in the closed interval [n, m]. Please see . This works fine when I enter both n and m as, for example, "23, 56", or even "56, 23". But often the closed interval is [1, m], so I'd like to not