Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 777671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:38:39+00:00 2026-05-14T19:38:39+00:00

Although I found many answers and discussions about this question, I am unable to

  • 0

Although I found many answers and discussions about this question, I am unable to find a solution particular to my situation. Here it is:

I have a main program written in FORTRAN.
I have been given a set of python scripts that are very useful.
My goal is to access these python scripts from my main FORTRAN program. Currently, I simply call the scripts from FORTRAN as such:

CALL SYSTEM (‘python pyexample.py’)

Data is read from .dat files and written to .dat files. This is how the python scripts and the main FORTRAN program communicate to each other.

I am currently running my code on my local machine. I have python installed with numpy, scipy, etc.

My problem:
The code needs to run on a remote server. For strictly FORTRAN code, I compile the code locally and send the executable to the server where it waits in a queue. However, the server does not have python installed. The server is being used as a number crunching station between universities and industry. Installing python along with the necessary modules on the server is not an option. This means that my “CALL SYSTEM (‘python pyexample.py’)” strategy no longer works.

Solution?:
I found some information on a couple of things in thread Is it feasible to compile Python to machine code?

Shedskin, Psyco, Cython, Pypy, Cpython API

These “modules”(? Not sure if that’s what to call them) seem to compile python script to C code or C++. Apparently not all python features can be translated to C. As well, some of these appear to be experimental. Is it possible to compile my python scripts with my FORTRAN code? There exists f2py which converts FORTRAN code to python, but it doesn’t work the other way around.

Any help would be greatly appreciated. Thank you for your time.

Vincent

PS: I’m using python 2.6 on Ubuntu

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:38:39+00:00Added an answer on May 14, 2026 at 7:38 pm

    One way or another, you’ll need to get the Python runtime on your server, otherwise it won’t be possible to execute Python bytecode. Ignacio is on the right track with suggesting invoking libpython directly, but due to Fortran’s parameter-passing conventions, it will be a lot easier for you to write a C wrapper to handle the interface between Fortran and the CPython embedding API.

    Unfortunately, you’re doing this the hard way — it’s a lot easier to write a Python program that can call Fortran subroutines than the other way around.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Although I have found some solutions to this problem, none of them refer to
Hopefully a simple question although one I have found impossible to answer myself using
this is my first question, although I've already used so many tips from Stack
After a long search I'm still confused about it although I found some related
although I searched through existing threads for my problem I havent found a solution
Although this code is from an algorithm text, I have a bit of a
Good morning, I have found that many of my customers have MS Access already
So this question is a sort of follow on from here ( how to
Here's some very simple sample HTML for purposes of this question: <!DOCTYPE html> <html>
Introduction I've found plenty of information about the Too many open files exception on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.