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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:07:22+00:00 2026-05-23T02:07:22+00:00

Given a set of python programs: /tool/a.py /tool/b.py /tool/c.py /tool/d.py … that are stored

  • 0

Given a set of python programs:

/tool/a.py
/tool/b.py
/tool/c.py
/tool/d.py
...

that are stored in a shared network directory, executed in a mixed environment (Solaris and different flavors of Linux) and that all requires a specific python version that may not be in the users $PATH and may not be installed in the same location on the different types of machines.

How can the programs specify what python interpreter to use?

Alternatives I’ve considered:

  1. A shebang in each python program, refereeing to a python wrapper that starts an appropriate python interpreter for the current type of machine. But execve does not allow the wrapper executable to be implemented as a shell script and compiling native executables for each machine would require a lot of maintenance.

  2. Making a startup shell script for each python program. All the shell scripts may share the same logic for choosing a python interpreter, but I would like to avoid having a separate shell script for each python program, if possible.

  3. Making some kind of hack to make each program possible to run both both as a shell script and a python program, similar to:

"""exec" /tool/python_wrapper "$0" "$@" """#"
def foo():
print "foo"
foo()

Do you have some other ideas?

  • 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-23T02:07:23+00:00Added an answer on May 23, 2026 at 2:07 am

    I would go with option 3. It will have a small startup delay, but it is the most flexible option.

    1. One would not work, since you are running in mixed environments it will be a nightmare to set everything up correctly.

    2. Would work but, as you said you’ll need to maintain both the .py program and the shell script. Also it is not much different then 3.

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

Sidebar

Related Questions

I can see that Collections.unmodifiableSet returns an unmodifiable view of the given set but
Is there an application , which can parse a given set of stored procedures
First the practical application that led me to the problem: Given a set of
I am the new maintainer for an in-house Python system that uses a set
I'm working on a python script that needs to run between two given times.
Are there any Python object-relational mapping libraries that, given a database schema, can generate
In Clearcase I can generate a label for a given set of files and
Given a set of words, we need to find the anagram words and display
Given a set of several million points with x,y coordinates, what is the algorithm
Given a set of phrases, i would like to filter the set of all

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.