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

  • Home
  • SEARCH
  • 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 6128083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:35:11+00:00 2026-05-23T16:35:11+00:00

I have a python script I want to distribute to Windows, where people might

  • 0

I have a python script I want to distribute to Windows, where people might not have python installed. So I use py2exe. The problem is in the script I run other python scripts by using subprocess, which requires python interpreter as the program to execute. As I don’t have python interpreter installed on Windows, is there any way I could ignore the interpreter and work around the problem? Is there any way I could call the python interpreter pakcaged by py2exe?

  • 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-23T16:35:12+00:00Added an answer on May 23, 2026 at 4:35 pm

    It’s probably more simple than you think: Instead of starting sub-processes, use the built-in eval() command to execute the scripts.

    [EDIT] To redirect stdio, replace sys.stdout/sys.stderr with buffers or something else that supports “write()”.

    To restore the original values, the sys module offers __stdout__, etc.

    [EDIT2] I haven’t tried this but it might work: Add “python.exe” to the set of files which py2exe creates.

    From the main code, copy all files that py2exe created + the python.exe into a temporary directory. Then add all your scripts.

    Now start the new python interpreter with a small script that adds the temp folder and library.zip to the sys.path

    Note: Python doesn’t have to be “installed” like a Windows application. In fact, you can simply copy all the files to a new place. As long as the search path is correct, this works.

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

Sidebar

Related Questions

I have Python script bgservice.py and I want it to run all the time,
I have a python script that i want to run from the command line
I have a Python script that I want to use as a controller to
I have created a Python script that I want to run daily via a
I have a simple Python script that I want to stop executing if a
I currently have Python 2.6.2 installed on my mac. I am writing a script
I have a python script, that generates kml files. Now I want to upload
I have a Python script I recently wrote that I call using the command
I have a python script that analyzes a set of error messages and checks
I have a Python script that needs to execute an external program, but for

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.