|
Is there any way to import all modules in the current directory, and return a list of them?
For example, for the directory with:
mod.py mod2.py mod3.py It will give you [<module 'mod'>, <module 'mod2'>, <module 'mod3'>]
Started by Jeffrey Aylesworth on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
To import the modules,this should work for i foo: eval("import " + i).
|
|
I have a Python script that uses built-in modules but also imports a number of custom modules that exist in the same directory as the main script itself.
For example, I would call
python agent.py
and agent.py has a number of imports, including:
import...
Started by DavidM on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Actually your....
Notice that the script directory is inserted before .
Install your modules in lib/site-packages to search modules in the current directory first.
Create .pth files in your lib/site-packages directory.
|
|
I have set
makepl_arg [INSTALLDIRS=site PREFIX=~/perl] mbuildpl_arg [--install_base ~/perl]
in the CPAN.pm configuration. I had hoped that this would cause modules to get installed in the same place, but I still have to set multiple paths in PERL5LIB:...
Started by Chas. Owens on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Tell it to install everything....
Have you tried using INSTALL_BASE for both? You have to set multiple directories because you're telling CPAN.pm to install in multiple directories.
It will handle all the configuration for you.
Install local::lib.
|
Ask your Facebook Friends
|
The only thing I can get python omnicomplete to work with are system modules. I get nothing for help with modules in my site-packages or modules that I'm currently working on.
Started by andrew on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Both times I was able to get guessing that the omnicomplete... .
I'm (mymodule.py), I puth in a directory in PYTHONPATH, and then in site-packages.
I get completion for my own modules in my PYTHONPATH or site-packages.
Of the functions for os.path.
|
|
I need to use some CPAN modules in my application. If the person who will use my application doesn't like to install the required CPAN modules by himself, or it is not allowed to install modules, how should I handle that?
Started by Haiyuan Zhang on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Or, you can copy the module's installation to your app's specific directory.
You can use PAR::Packer to create an executable bundle that contains all the CPAN modules your app needs to run.
|
|
Hi,
What would be the best directory structure strategy to share a utilities module across my python projects? As the common modules would be updated with new functions I would not want to put them in the python install directory.
project1/ project2/ ...
Started by iKarampa on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Exactly where you.
Since every user can set his own to import modules in sharedUtils , then you can achieve this by using a .pth file.
The directories that python searches when looking for modules.
|
|
Hi Guys, I have perl module file and test script pl which I use to run some function, and after browsing through the use lib and this previous question here... I still don't know how to do this.
Basically I have a production directory which contains the...
Started by melaos on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Another thing it the first-searched directory....
But the first step is finding out what directory the module was loaded from.
Remember that the current directory (".") is usually an entry in @INC .
That might give you a clue.
|
|
I'm using a hosted Linux machine so I don't have permissions to write into the /usr/lib directory.
When I try to install a CPAN module by doing the usual:
perl Makefile.PL make test make install
That module is extracted to a blib/lib/ folder. I have kept...
Started by ram on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
In general, if you want? From perlfaq8:
How do I keep my own module/library directory?
When you build modules, tell Perl where configuration....
To a directory you can write to, and it will tell perl how to get at those modules.
|
|
Is it possible to detect mod_rewrite in PHP when function apache_get_modules() is not available?
Started by tomp on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In my Ubuntu(); phpinfo(INFO_MODULES); $contents = ob_get_contents(); ob_end_clean(); var_dump(strpos($contents.
You can check if the rewrite.load file exists in the Apache mods-enable directory.
|
|
Hi
Imagine a maven project with 3 modules, an interface module and two different implementations of this interface in a module each. I could test each implementation in its own module, but the test cases are basically the same, because of the same interface...
Started by Juri Glass on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
The tests project will then create a target directory under each impl_? subdirectory;scope>test</scope> <....
module, it would now include modules like
<module>../interface</module> <module> dependencies.
|