Re: [Tutor] Need a better name for this function

2009-12-17 Thread Dave Angel
Richard D. Moores wrote: On Wed, Dec 16, 2009 at 20:23, Dave Angel wrote: Richard D. Moores wrote: There are conceivably better ways to get at the mantissa of the fp number, but you can simply parse the hex digits as I did manually, and add one and subtract one from the given mant

[Tutor] How to run two os.system commands simultaneously

2009-12-17 Thread pedro
Hi, I have two computationally intensive commands that I would like to render simultaneously on two fifferent computers. When I run these two commands, os.system(theTerminalCommandMacPro4) os.system(theTerminalCommandMacPro1) the second command doesn't begin until the first command has finish

[Tutor] how to see a terminal window showing progress of os.system

2009-12-17 Thread pedro
Hi I am sending commands to the command line using python's os.system. Is there a way to see a terminal window showing the progress of os.system as if you had just run the command from a normal terminal window? As it is now it runs completely in the background ___

Re: [Tutor] How to run two os.system commands simultaneously

2009-12-17 Thread Kent Johnson
On Thu, Dec 17, 2009 at 9:29 AM, pedro wrote: > Hi, I have two computationally intensive commands that I would like to > render simultaneously on two fifferent computers. When I run these two > commands, > > os.system(theTerminalCommandMacPro4) > os.system(theTerminalCommandMacPro1) > > > the seco

Re: [Tutor] How to run two os.system commands simultaneously

2009-12-17 Thread pedro
On 2009-12-17 09:52:34 -0500, Kent Johnson said: call os.system() in a thread Hi Kent, pardon my ignorance but what do you mean by call os.system() in a thread? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription optio

Re: [Tutor] Need a better name for this function

2009-12-17 Thread Richard D. Moores
On Thu, Dec 17, 2009 at 02:13, Dave Angel wrote: > Try the following in Python 3.1: > > def increment(floatval, incr=1): >   #Given a float of "reasonable" size, increment it by smallest amount >   #  and if incr is -1, then decrement >   stringval = floatval.hex() >   mantissa, exponent = string

Re: [Tutor] How to run two os.system commands simultaneously

2009-12-17 Thread Kent Johnson
On Thu, Dec 17, 2009 at 10:14 AM, pedro wrote: > On 2009-12-17 09:52:34 -0500, Kent Johnson said: > >> call os.system() in a thread > > Hi Kent, pardon my ignorance but what do you mean by call os.system() in a > thread? Your basic problem is that os.system() blocks - it waits until the new proc

[Tutor] Please take a look at this function

2009-12-17 Thread Richard D. Moores
def prestrings2list(a_str): word = "" list_of_strings = [] length_of_a_string = len(a_str) for i, char in enumerate(a_str): if i == length_of_a_string - 1: word += char word = word.rstrip() list_of_strings.append(word) elif char ==

Re: [Tutor] how to see a terminal window showing progress of os.system

2009-12-17 Thread Alan Gauld
"pedro" wrote Hi I am sending commands to the command line using python's os.system. Is there a way to see a terminal window showing the progress of os.system as if you had just run the command from a normal terminal window? As it is now it runs completely in the background You can someti

Re: [Tutor] Please take a look at this function

2009-12-17 Thread Kent Johnson
On Thu, Dec 17, 2009 at 7:57 PM, Richard D. Moores wrote: > def prestrings2list(a_str): >     word = "" >     list_of_strings = [] >     length_of_a_string = len(a_str) >     for i, char in enumerate(a_str): >     if i == length_of_a_string - 1: >     word += char >     word =

Re: [Tutor] Please take a look at this function

2009-12-17 Thread Richard D. Moores
On Thu, Dec 17, 2009 at 18:26, Kent Johnson wrote: > > On Thu, Dec 17, 2009 at 7:57 PM, Richard D. Moores wrote: > > def prestrings2list(a_str): > >     word = "" > >     list_of_strings = [] > >     length_of_a_string = len(a_str) > >     for i, char in enumerate(a_str): > >     if i == leng

Re: [Tutor] Please take a look at this function

2009-12-17 Thread Dave Angel
Richard D. Moores wrote: def prestrings2list(a_str): word = "" list_of_strings = [] length_of_a_string = len(a_str) for i, char in enumerate(a_str): if i == length_of_a_string - 1: word += char word = word.rstrip() list_of_strings.append

Re: [Tutor] Please take a look at this function

2009-12-17 Thread Hugo Arts
On Fri, Dec 18, 2009 at 3:44 AM, Richard D. Moores wrote: > On Thu, Dec 17, 2009 at 18:26, Kent Johnson wrote: >> >> On Thu, Dec 17, 2009 at 7:57 PM, Richard D. Moores >> wrote: >> > def prestrings2list(a_str): >> >     word = "" >> >     list_of_strings = [] >> >     length_of_a_string = len(a

Re: [Tutor] Please take a look at this function

2009-12-17 Thread Richard D. Moores
On Thu, Dec 17, 2009 at 19:49, Hugo Arts wrote: > Probably easiest to use a regular expression to fix that particular > thing, as in: > > import re > mult_space = re.compile(r'\s+') > def prestrings2list(a_str): >return [re.sub(mult_space, ' ', x).strip() for x in a_str.split(',')] > > Hugo

[Tutor] What is URL to online Python interpreter?

2009-12-17 Thread Benjamin Castillo
What is URL to online Python interpreter? Ben ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Generating Unique Permutations

2009-12-17 Thread Michael Morrissey
I'm just a philosophy teacher, and I don't know much about mathematics or computers. I'm writing a python program (not the best language for this topic, but it is what I know), and I need to solve a problem which requires more knowledge than I have. I'm hoping you can help me. =) I'm looking for a

Re: [Tutor] Generating Unique Permutations

2009-12-17 Thread Shashwat Anand
create your desired list >>> l = ['a', 'a', 'b', 'b'] do a permutation and take unique values >> import itertools >> set(itertools.permutations(l)) HTH On Fri, Dec 18, 2009 at 11:24 AM, Michael Morrissey wrote: > I'm just a philosophy teacher, and I don't know much about mathematics or > comput

Re: [Tutor] What is URL to online Python interpreter?

2009-12-17 Thread Senthil Kumaran
On Thu, Dec 17, 2009 at 09:32:44PM -0800, Benjamin Castillo wrote: > What is URL to online Python interpreter? Google could have helped you too. Anyways, http://shell.appspot.com/ -- Senthil ___ Tutor maillist - Tutor@python.org To unsubscribe or cha