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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:56:37+00:00 2026-05-13T09:56:37+00:00

i can’t find who defined the ‘__path__’ ,why ‘__path__’ can be use. import os

  • 0

i can’t find who defined the '__path__',why '__path__' can be use.

import os
import sys
import warnings 
import ConfigParser # ConfigParser is not a virtualenv module, so we can use it to find the stdlib

dirname = os.path.dirname

distutils_path = os.path.join(os.path.dirname(ConfigParser.__file__), 'distutils')
if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)):
    warnings.warn(
        "The virtualenv distutils package at %s appears to be in the same location as the system distutils?")
else:
    __path__.insert(0, distutils_path)#who defined me.???
    exec open(os.path.join(distutils_path, '__init__.py')).read()
  • 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-13T09:56:38+00:00Added an answer on May 13, 2026 at 9:56 am

    You really need to read some Python documentation and learn the basics of the language.

    I checked, and you seem to speak Chinese. Here are Python documentation resources in Chinese:

    http://www6.uniovi.es/python/doc/NonEnglish.html#chinese

    Now, to answer your question. I wasn’t sure what the answer was, so I used Google. I did a Google search for “Python __path__” and very quickly found:

    http://docs.python.org/tutorial/modules.html

    6.4.3. Packages in Multiple Directories

    Packages support one more special
    attribute, __path__. This is
    initialized to be a list containing
    the name of the directory holding the
    package’s __init__.py before the code
    in that file is executed. This
    variable can be modified; doing so
    affects future searches for modules
    and subpackages contained in the
    package.

    While this feature is not often
    needed, it can be used to extend the
    set of modules found in a package.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
Does anyone know how can I replace this 2 symbol below from the string
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I want use html5's new tag to play a wav file (currently only supported
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I want to count how many characters a certain string has in PHP, but
I have text I am displaying in SIlverlight that is coming from a CMS

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.