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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:36:35+00:00 2026-06-14T03:36:35+00:00

I would like to patch up the Python source so I can statically link

  • 0

I would like to patch up the Python source so I can statically link it into my Windows application (I am aware that this is not easy or even encouraged because of how especially the core modules get loaded).

Can I leave out certain “core modules” despite the name that suggests that they are required?

I’m thinking of _tkinter, _ssl and ssl (not 100% sure whether I want to remove that one, yet), winsound and w9xpopen (it’s only going to be used on the NT platform) here. Is that possible or will that break things in subtle ways?

NB: please, no need to mention that static linking is bad for some reason or another. For the case I need it, it would be the superior solution by far.

  • 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-06-14T03:36:36+00:00Added an answer on June 14, 2026 at 3:36 am

    Not sure if you still needed this answer, given how long ago you asked this question, but I figured I’d leave some of the info I’ve found out, since I wondered the same thing:

    Note: This is based on the source tree for Python 2.7.3

    There’s a few python modules that depend on the _ssl/ssl modules, but they all have error checking to support versions of Python without SSL, and will just disable that functionality.

    The included python modules that make use of the ssl module are:

    • socket
    • ftplib
    • httplib
    • imaplib
    • poplib
    • smtplib
    • urllib
    • xmlrpclib

    Since you’re embedding it into your own app, I’d probably also part with _msi. (which would allow you to remove the msilib module)

    If you went ahead and removed the extensions you mentioned, you’d always want to get rid of the following python modules from the Lib folder:

    • lib-tk
    • ssl
    • wave (I’m assuming you don’t need support for parsing wave files, since you dropped winsound)
    • sunau ( ^ )
    • sunaudio ( ^ )
    • audiodev ( ^ )
    • aifc ( ^ )
    • chunk ( ^ )
    • toaiff ( ^ )

    I’m assuming this is a GUI app, so you probably won’t need the following Python modules:

    • curses
    • tty
    • pty
    • rlcompleter

    Not sure what your app does/did, though, so I’ll be conservative with the rest.

    As for the builtin modules, written in C, I can’t guarantee this to be 100% problem-free, but you should be able to remove some of the following, depending on what your application actually needs.

    • _csv
    • _json (though this module offers speedups for the python-only json module)
    • _hotshot (If you don’t need hotshot, which is a logging profiler)
    • imageop

    Probably some others here, too.

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

Sidebar

Related Questions

In a Python application that uses gettext to provide support for internationalization, I would
I would like to write a Python function that is capable of taking a
I would like to get file path as input in my Python console application.
In a python application I'm working on I would like to dynamically load packages
I would like to generate a patch with all commits from a local branch.
I would like to track the path that leads to a 404 with Google
I would like to create a button control that has a Path element as
I would like to be able to control a remote Python interpreter over an
I would like to replace every line that starts with a certain expression (example:
I would like to install some packages into a third-party site-packages directory (beyond the

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.