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 3493070
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:50:12+00:00 2026-05-18T11:50:12+00:00

I have this C program, at least I think it is (files: spa.c, spa.h).

  • 0

I have this C program, at least I think it is (files: spa.c, spa.h). Is there any way I can execute this script from Python WITHOUT passing extra arguments to the Python interpreter (if not, what would the arguments be?)

Update: Thanks for your replies. The source code can be found at http://www.nrel.gov/midc/spa/#register

(Please do not be scared by the ‘register’ in the url, if you fill in the form, you can immediately download the files (no validation mails, etc) I will try your suggestions and report back with the results.

Update 2: I compiled the source code using gcc, but now it gives me a permission denied when trying to call(), even when running python as root (im on Ubuntu 10:10).

Update 3 [Errno 8] Exec format error

Update 4 Ok, I got it working. Program outputs values using printf:

>>> call(['/path'])
Julian Day:    2452930.312847
L:             2.401826e+01 degrees
B:             -1.011219e-04 degrees
R:             0.996542 AU
H:             11.105902 degrees
Delta Psi:     -3.998404e-03 degrees
Delta Epsilon: 1.666568e-03 degrees
Epsilon:       23.440465 degrees
Zenith:        50.111622 degrees
Azimuth:       194.340241 degrees
Incidence:     25.187000 degrees
Sunrise:       06:12:43 Local Time
Sunset:        17:20:19 Local Time

Thanks all!

  • 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-18T11:50:13+00:00Added an answer on May 18, 2026 at 11:50 am

    There is no such thing as a C script. If you meant a C program you need to compile spa.c and spa.h into an executable before running it.

    If you use GCC in Linux or Mac OS X:

    $ gcc -Wall spa.c -o spa
    

    Will get you an executable named spa.

    After that, you can run spa program from your Python script with:

    from subprocess import call
    call(["./spa", "args", "to", "spa"])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C/C++ program that's a plugin to Firefox. Because it's a plugin,
I have this very huge XML file of size 2.8GB. This is Polish Wikipedia's
I wrote a Linux program based on a buggy open source library. This library
Alright, so I'm writing this program that essentially batch runs other java programs for
Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument I'm very confused about
I have little program creating a maze. It uses lots of collections (the default
I have a program which uses an io_service and several threads. It instantiates some
I have a question about program exit state in Linux. In my program, I
At work I've been tasked with turning a bunch of HTML files into a
This question is not so much programming related as it is deployment related. I

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.