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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:32:50+00:00 2026-05-19T22:32:50+00:00

Hi I am building a simple application that will have a combo box to

  • 0

Hi I am building a simple application that will have a combo box to select python scripts that are in a directory called scripts to create reports on a database. I was going to use py2exe to build the program so that the users don’t have to have python and submoduals installed.

so how would i go about having the program run these scripts using the py2exe dist?

i thought about using system(‘command’) and copying the python.exe from my install directory to just run system(os.curdir+’python.exe ‘ + script_to_run) the python.exe would then use the local copy of the python.dll and the libs that it needs to run which would just be reportlab and pyobdc

would that work or is there a better way?

(i also wouldn’t mind building it in ironpython if that would be easier)

  • 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-19T22:32:50+00:00Added an answer on May 19, 2026 at 10:32 pm

    Micheal Foord has the following example for Embedding Ironpython from within Ironpython

    The basic steps are to create your shell application. For a real lightweight GUI there is EasyWPF. Use pyc to compile your script to an exe and the standard library into a DLL. Depending on if you need to capture stdout from the scripts or pass variables in information into them, things can get more complicated as indicated in the article. A basic example is listed below.

    import clr
    clr.AddReference('IronPython')
    clr.AddReference('System')
    clr.AddReference('mscorlib')
    clr.AddReference('Microsoft.Scripting')
    clr.AddReference('MyStandardLib')
    #Now you can reference things like 'import lxml as L .....
    
    from IronPython.Hosting import Python
    from Microsoft.Scripting import SourceCodeKind
    
    spath = "C:/fred.py"  # Path to script
    
    
    engine = Python.CreateEngine()
    #Now add your assemblies (like the standard library) to the engine
    for assembly in clr.References:
        runtime.LoadAssembly(assembly)
    
    source = engine.CreateScriptSourceFromFile(spath, SourceCodeKind.Statements)
    mod = engine.CreateScope()
    runtime = engine.Runtime
    
    source.Execute(mod)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a very simple application .net Console Application that will execute a SQL
I'm trying to create a simple application that is only supposed to be called
I'm building a Rails 3 application that will have user-specific settings (looks, functionality, etc)
I have a simple application using netbeans for developing and maven for building et
I am building a simple Django app that will use scribd to display documents.
I'm looking at building a simple web app that will expose an API that
I'm building a Zend-based Web app that will permit third-party extensions. Essentially, this application's
I'm building a simple Todo List application where I want to be able to
I am building a relatively simple Django application and apart from the main page
I'm building a simple ASP.NET web application in VS 2008 with a SQL 2005

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.