On Tue, Jan 26, 2010 at 1:40 PM, Paul Moore <p.f.mo...@gmail.com> wrote:

> 2010/1/26 Nick Coghlan <ncogh...@gmail.com>:
> > Glenn Linderman wrote:
> >> That would seem to go a long ways toward making the facility user
> >> friendly, at least on Windows, which is where your complaint about icons
> >> was based, and the only change to Python would be to recognize that if a
> >> .py contains a .zip signature,
> >
> > That should work today - the zipfile/directory support shouldn't care
> > about the filename at all (although the test suite doesn't currently
> > cover any extensions other than .zip, so I could be wrong about that...).
>
> You're right, it works:
>
> >type __main__.py
> print "Hello from a zip file"
>
> >zip mz.py __main__.py
>  adding: __main__.py (172 bytes security) (stored 0%)
>
> >mz.py
> Hello from a zip file
>

Sadly you can't then do:

  chmod +x mz.py
  ./mz.py

because it doesn't have "#!/usr/bin/env python" like typical executable
Python scripts have.  You can put the shebang line at the beginning of the
zip file, and zip will complain about it but will still unpack the file, but
it won't be runnable as Python won't recognize it as a zip anymore.  Now if
you could, say, put in "#!/usr/bin/env pythonz" (and then implement a
pythonz command that could do useful stuff) then that might work.  Though
generally #! is so broken that it's really hard to come up with a reasonable
option for these cases.

-- 
Ian Bicking  |  http://blog.ianbicking.org
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to