Integrating Python with Fortran

2006-10-31 Thread unexpected
Hi all, I'm currently working on a large, legacy Fortran application. I would like to start new development in Python (as it is mainly I/O related). In order to do so, however, the whole project needs to be able to compile in Fortran. I'm aware of resources like the F2Py Interface generator, but

Re: Python regular expression question!

2006-09-20 Thread unexpected
Sweet! Thanks so much! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python regular expression question!

2006-09-20 Thread unexpected
> \b matches the beginning/end of a word (characters a-zA-Z_0-9). > So that regex will match e.g. MULTX-FOO but not MULTX-. > So is there a way to get \b to include - ? -- http://mail.python.org/mailman/listinfo/python-list

Python regular expression question!

2006-09-20 Thread unexpected
I'm trying to do a whole word pattern match for the term 'MULTX-' Currently, my regular expression syntax is: re.search(('^')+(keyword+'\\b') where keyword comes from a list of terms. ('MULTX-' is in this list, and hence a keyword). My regular expression works for a variety of different keyword

Strange import behavior

2006-09-01 Thread unexpected
Hey guys, I'm having problems importing a file into my python app. Everytime I try to define the object specified by this file, i.e, test = Test(), It raises an ImportError exception: ImportError: cannot import name Test. I've declared it as: from test import Test (and I've also tried from tes

Re: Avoiding if..elsif statements

2006-08-25 Thread unexpected
;t include them the first time, I was trying to simplify it to make it easier...oops! Fredrik Lundh wrote: > "unexpected" <[EMAIL PROTECTED]> wrote: > > > I have a program where based on a specific value from a dictionary, I > > call a different function. Cur

Avoiding if..elsif statements

2006-08-25 Thread unexpected
I have a program where based on a specific value from a dictionary, I call a different function. Currently, I've implemented a bunch of if..elsif statements to do this, but it's gotten to be over 30 right now and has gotten rather tedious. Is there a more efficient way to do this? Code: value = s

Printing n elements per line in a list

2006-08-15 Thread unexpected
If have a list from 1 to 100, what's the easiest, most elegant way to print them out, so that there are only n elements per line. So if n=5, the printed list would look like: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 etc. My search through the previous posts yields methods to print all the values of t