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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:24:18+00:00 2026-06-06T20:24:18+00:00

The -S option to python is defined by the documentation as Disable the import

  • 0

The -S option to python is defined by the documentation as “Disable the import of the module site and the site-dependent manipulations of sys.path that it entails.” I’ve found that python startup on my machine is more than twice as fast, sometimes much more, when I use this option. For example, on one (slow) machine:

$ time python -c 'print "hello"'   
hello
python -c 'print "hello"'  0.14s user 0.03s system 85% cpu 0.204 total

$ time python -Sc 'print "hello"'
hello
python -Sc 'print "hello"'  0.02s user 0.01s system 73% cpu 0.038 total

That’s a 5.3x speedup. And it seems to work fine, at least with the scripts I’ve tried. What are the disadvantages to using it?

  • 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-06T20:24:20+00:00Added an answer on June 6, 2026 at 8:24 pm

    It’s probably not a good idea. Among other things, it means that the site-packages directory won’t be added to the path, so you won’t be able to import anything but the standard lib modules:

    python -Sc "import numpy"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named numpy
    

    You can look at site.py yourself to see what it’s doing. It’s just a module in the regular library directory. At least on my system, it looks like it does four main things:

    • sets up the site-packages paths
    • sets the default encoding
    • defines a few helper functions for interactive use (quit and help)
    • sets up user-specific site customization

    The first one is probably the most critical, as mentioned above. The second could be important for doing string I/O depending on your system’s locale settings (i.e., you may get errors if the default encoding isn’t correctly set). The third is probably not that important. The last one could be important if you like to have per-user path customizations (letting users have their own personal library directories, etc.).

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

Sidebar

Related Questions

Python has a flag -O that you can execute the interpreter with. The option
How do I code in python the option that when the output file exists
I have a django site within virtual environment that uses Python 2.6 installed with
What are some toolkits for developing 2D games in Python? An option that I
I encounter the following small annoying dilemma over and over again in Python: Option
Is there any free and open-source option to run python from an usb-stick on
I installed the wxmac (wx) homebrew formular with the --python and the --devel option
A question that seems to have quite a few options for Python, but none
I am using Python for automating a complex procedure that has few options. I
I have renamed a python class that is part of a library. I am

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.