473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

importhook default behavior

I have a situation where I am wanting strict control over handling
multiple installed versions of the same modules.

All I really want to do is map a package name to a directory special
directory, and from there allow the standard python importing to continue.

I've got it working for the simple case, but it seems up to my
importhook to duplicate a lot of the standard import functionality.
Especially if it comes to importing subpackages of packages inside my
magic versioned package.

What I'd like to do is determine the real directory to use, and make a
call to the regular python importing tools. Is there somewhere in Python
I can find an importhook object that represents the default python behavior?

I suppose the ZipImport has all the functionality I'd need, but it seems
odd to be recode all that logic (.pyc or .pyo first, .dll or .so, .py,
or if directory look for __init__.[anyext]. recursive). Maybe that isn't
so hard after all.
Jul 18 '05 #1
0 1059

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: J.R. | last post by:
Hi folks, The python can only support passing value in function call (right?), I'm wondering how to effectively pass a large parameter, such as a large list or dictionary? It could achieved...
14
by: Xah Lee | last post by:
is there somewhere i can find the default css for browsers? e.g. what's the usual rendering in terms of css for <p>, <ul> etc. in particular, right now i'm interested in creating a style...
0
by: silesius | last post by:
I've been using VS 2003 to develop a webapplication using C#. Today I exported the application to a remote webserver I begun experiencing problems. It's a simple application that retrieves some...
7
by: aDc | last post by:
Hello, I am getting some strange behavior with my ASP.NET application. Anytime I make a request to a page in the application the page_load for that page is fired as expected BUT then the...
2
by: Seigfried | last post by:
I've been reading the Microsoft Press book "Visual Basic .NET Step by Step" (Michael Halvorson). I've noticed something about menu items while reading chapter 4 that I didn't know before. Please...
7
by: howa | last post by:
e.g. #include<iostream> using namespace std; int main() { double *d = new double;
28
by: v4vijayakumar | last post by:
#include <string> #include <iostream> using namespace std; int main() { string str; str.resize(5); str = 't';
35
by: bukzor | last post by:
I've found some bizzare behavior when using mutable values (lists, dicts, etc) as the default argument of a function. I want to get the community's feedback on this. It's easiest to explain with...
1
by: =?Utf-8?B?TU5C?= | last post by:
Hi there! We are near the ending stage of an ASP.NET + IIS project, and started doing stress testing on the servers. We find ourselves with a very strange behavior, that can’t figure out since...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.