[Tutor] Running and passing variables to/from Fortran

2007-05-06 Thread John Washakie
I have a FORTRAN program which reads in unformatted sparse matrix data. Rather than rewriting the code in Python, I was hoping there is a way to call the Fortran program, passing filename variables TO Fortran, and returning the data (which is an array) back to my .py code for use there. Is there a

Re: [Tutor] Running and passing variables to/from Fortran

2007-05-06 Thread Andreas Kostyrka
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Simple is the wrong idea. But I'd guess that you can access your Fortan from C. If so, Pyrex provides a C-for-Python-coder tool. OTOH, just reading the stuff in Python might be simpler than doing all the interfacing. (I presume that you are just readin

[Tutor] when to introduce classes

2007-05-06 Thread Rohan Deshpande
Hi All, I am wondering when is a good time to introduce classes into a python program. Is there any rule of thumb as to when they are necessary, and when it is okay to just stick with regular functions and variables? I.e. you have self defined methods and data working on the same type of task? T

[Tutor] Working with error messages

2007-05-06 Thread Alan Gilfoy
I have a number-to-Roman numeral program that churns out ValueError messages with a few improper input cases: 1. not an integer 2. larger than 3999 3. smaller than 0 When I run the program via IDLE, and I give one of these improper inputs, the interpreter closes down the program and then disp

Re: [Tutor] Working with error messages

2007-05-06 Thread Andre Engels
2007/5/6, Alan Gilfoy <[EMAIL PROTECTED]>: > I have a number-to-Roman numeral program that churns out ValueError > messages with a few improper input cases: > > 1. not an integer > 2. larger than 3999 > 3. smaller than 0 > > When I run the program via IDLE, and I give one of these improper > inputs

[Tutor] command lines

2007-05-06 Thread Jason Coggins
Is there a way to send a command to the Linux Terminal from inside a Python program? Jason___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] command lines

2007-05-06 Thread Rikard Bosnjakovic
On 5/6/07, Jason Coggins <[EMAIL PROTECTED]> wrote: > Is there a way to send a command to the Linux Terminal from inside a Python > program? os.system(), os.popen(), etc. -- - Rikard - http://bos.hack.org/cv/ ___ Tutor maillist - Tutor@python.org ht

Re: [Tutor] when to introduce classes

2007-05-06 Thread Kent Johnson
Rohan Deshpande wrote: > Hi All, > > I am wondering when is a good time to introduce classes into a python > program. Is there any rule of thumb as to when they are necessary, > and when it is okay to just stick with regular functions and > variables? http://personalpages.tds.net/~kent37/stories

Re: [Tutor] Running and passing variables to/from

2007-05-06 Thread emilia12
hi john, what about f2py - Fortran to Python interface generator Port description for lang/f2py Writing Python C/API wrappers for Fortran routines can be a very tedious task, especially if a Fortran routine takes more than 20 arguments but only few of them are relevant for the problems that they

Re: [Tutor] can python run under windows 95?

2007-05-06 Thread Alexander Kapshuk
Hello Everyone, Quick question ... I've got an old Toshiba Satellite 110CT laptop with Windows 95 installed on it. It's got 40 MB of RAM and a 3 GB hard drive. Would I be able to run Python on it? If so, what version of Python should I install? I've tried installing Python 2.5 on it