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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:02:41+00:00 2026-05-13T16:02:41+00:00

I use python to patch system settings of linux systems distributed with partimage. I

  • 0

I use python to patch system settings of linux systems distributed with partimage.
I want to have the following python script structure:

/patch.d/
    10_patch_netwok.py
    20_patch_hostname.py
    ...
    50_patch_software_xyz.py

InitSystem.py

The InitSytem.py should run the python scripts in /patch.d folder. Following my idea (brainstorm):

files = glob.glob("patch.d/*.py")
files.sort()
for file in files:
    execfile(file, ...)

What’s the recommend way to load python scripts and run them from another python script?

  • 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-13T16:02:42+00:00Added an answer on May 13, 2026 at 4:02 pm

    Python scripts are also python modules, so the best way to load and run them is to simply import them using

    __import__('some_module')
    

    This will mean that they run in the same process though. If this is undesirable, then your options would be to use the multi-threading or multi-processing support in python to run each script in a different thread/process to avoid interference, or to use the os.subprocess module to do system calls that run the scripts.

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

Sidebar

Related Questions

There's Python 2.6 installed in the system. Now I want to use modules introduced
I use python 2.7. I have data in file 'a': myname1@abc.com;description1 myname2@abc.org;description2 myname3@this_is_ok.ok;description3 myname5@qwe.in;description4
I use python -m SimpleHTTPServer when I want to run my web application locally,
I want to write some python package installing script in Python into virtualenv. I
We have a common python installation for all of our systems in order to
I'm trying to install virtual-python on linux server which I don't have root access.
I have a problem with python-config --ldflags on OS X 10.6.2. Using my non-system
I want to write a script (generate_script.py) generating another python script (filegenerated.py) So far
I have been trying to use Eclipse 3.6 as a Python editor. I install
I have a system python installation and a personal python installation in my home

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.