Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   can python import class or module directly from a zip package (http://www.velocityreviews.com/forums/t675118-can-python-import-class-or-module-directly-from-a-zip-package.html)

Flank 03-10-2009 05:13 PM

can python import class or module directly from a zip package
 
can python import class or module directly from a zip package ,just
like jave does from jar package without extracting the class file into
directory

so far as i know ,python module should be unzip to file system in
order to use them,

Stefan Behnel 03-10-2009 05:21 PM

Re: can python import class or module directly from a zip package
 
Flank wrote:
> can python import class or module directly from a zip package


Yes, just put the .zip file into your PYTHONPATH.

Stefan

Seairth Jacobs 03-10-2009 05:49 PM

Re: [!! SPAM] can python import class or module directly froma zip package
 
Flank wrote:
> can python import class or module directly from a zip package ,just
> like jave does from jar package without extracting the class file into
> directory
>
> so far as i know ,python module should be unzip to file system in
> order to use them,
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>

See http://peak.telecommunity.com/DevCenter/PythonEggs.


Lorenzo 03-11-2009 01:47 PM

Re: can python import class or module directly from a zip package
 
On Mar 10, 2:13*pm, Flank <fla...@gmail.com> wrote:
> can python import class or *module directly from *a zip package ,just
> like jave does from jar package without extracting the class file into
> directory
>
> so far as i know ,python module should be unzip to file system in
> order to use them,


After a little digging/googling, the answer came right from the docs:

http://docs.python.org/library/zipimport.html

I think that this module is just right what you need.

Cheers!

Gabriel Genellina 03-11-2009 02:03 PM

Re: can python import class or module directly from a zip package
 
En Wed, 11 Mar 2009 11:47:54 -0200, Lorenzo <loluengo@gmail.com> escribió:
> On Mar 10, 2:13*pm, Flank <fla...@gmail.com> wrote:


>> can python import class or *module directly from *a zip package ,just
>> like jave does from jar package without extracting the class file into
>> directory
>>
>> so far as i know ,python module should be unzip to file system in
>> order to use them,

>
> After a little digging/googling, the answer came right from the docs:
>
> http://docs.python.org/library/zipimport.html
>
> I think that this module is just right what you need.


Note that you don't have to do anything special to use zipimport; it's
enabled by default.
Just make sure your zip file name is present in sys.path, as if it were a
directory.

--
Gabriel Genellina


Coonay 03-12-2009 12:28 PM

Re: can python import class or module directly from a zip package
 
On Mar 11, 9:47*pm, Lorenzo <lolue...@gmail.com> wrote:
> On Mar 10, 2:13*pm, Flank <fla...@gmail.com> wrote:
>
> > can python import class or *module directly from *a zip package ,just
> > like jave does from jar package without extracting the class file into
> > directory

>
> > so far as i know ,python module should be unzip to file system in
> > order to use them,

>
> After a little digging/googling, the answer came right from the docs:
>
> http://docs.python.org/library/zipimport.html
>
> I think that this module is just right what you need.
>
> Cheers!


thanks you 2 guys


All times are GMT. The time now is 12:48 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.