partial translation of python code

Completado Publicado Dec 20, 2004 Pagado a la entrega
Completado Pagado a la entrega

Please write a PARTIAL Python to Fortran translator in Python that implements the following rules. You do not need to know any Fortran to do this. After the rules, a simple Python code

and the desired Fortran equivalent follow.

(1) replace """ ... """ comments in Python with a leading "!"

on each comment line in Fortran

(2) replace a leading comment # with !

(3) replace True with .true., False with .false.

(4) replace elif with else if

(5) replace

if x:

with

if (x) then

(6) replace

elif x:

with

else if (x) then

(7) replace

else:

with

else

(8) at the end of an if block in Python add an end if

to the corresponding Fortran

(9) replace

print x,y,z

with

print*,x,y,z

(10) replace [] with ()

(11) replace def foo(x,y):

with

function foo(x,y) result(foo_)

(12) within a function, where there is a return statement, set the Fortran result and then return

(13) add an "end function function_name" to the end of a Fortran function

(14) within a conditional statement, replace and with .and. and

or with .or.

## Deliverables

Python code that works with Python 2.4 . You can use the code as you wish but grant me the right to use and redistribute it.

## Platform

Windows XP, but should be run on any platform with Python 2.4 .

Ingeniería MySQL PHP Python Arquitectura de software Verificación de software

Nº del proyecto: #3487890

Sobre el proyecto

5 propuestas Proyecto remoto Activo Dec 21, 2004

Adjudicado a:

pimiela

See private message.

$85 USD en 7 días
(33 comentarios)
4.6

5 freelancers están ofertando un promedio de $97 por este trabajo

ffunch

See private message.

$85 USD en 7 días
(17 comentarios)
5.1
jazzido

See private message.

$127.5 USD en 7 días
(39 comentarios)
5.0
marcodvw

See private message.

$85 USD en 7 días
(21 comentarios)
4.3
olpa

See private message.

$102 USD en 7 días
(7 comentarios)
3.8