Tsila Hassine | 1 Mar 01:57
Picon

Re: "IOError: decoder jpeg not available"

Hello again,

Problem finally solved : had to reinstall and rebuild PIL (from tar) - this time pointing the setup.py to the right location of jpeg-6b library, and ONLY THEN running setup.py build_ext -i of Imaging1.1.6

hope someone can make use of this,
Tsila

On 3/1/07, Tsila Hassine <tsila.hassine <at> gmail.com> wrote:
Hello all!

sorry - pretty much of a novice....
here's a snippet I am running from the Python interactive interface  - and the error I am getting:

 
>>> import Image, imghdr
>>> im= Image.open('test406.jpg')
>>> new_image=im.resize((100.0,100.0), Image.ANTIALIAS)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PIL/Image.py", line 1188, in resize
    self.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PIL/ImageFile.py", line 180, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig )
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PIL/Image.py", line 328, in _getdecoder
    raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available





I seem to have PIL in stalled in 2 different locations (don't know if that may cause the problem):
1: ./Library/Python/2.3/PIL

2: ./Library/Python/2.3/site-packages/PIL

when I tried to reinstall imaging1.1.5 I got the following :

--- TKINTER support ok
*** JPEG support not available
--- ZLIB (PNG/ZIP) support ok
*** FREETYPE2 support not available



although I have jpeg-6b in ./jpeg6-and I also re installed adn got the following :
% make -n install                            
/usr/bin/install -c cjpeg /usr/local/bin/cjpeg
/usr/bin/install -c djpeg /usr/local/bin/djpeg
/usr/bin/install -c jpegtran /usr/local/bin/jpegtran
/usr/bin/install -c rdjpgcom /usr/local/bin/rdjpgcom
/usr/bin/install -c wrjpgcom /usr/local/bin/wrjpgcom
/usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/man/man1/cjpeg.1
/usr/bin/install -c -m 644 ./djpeg.1 /usr/local/man/man1/djpeg.1
/usr/bin/install -c -m 644 ./jpegtran.1 /usr/local/man/man1/jpegtran.1
/usr/bin/install -c -m 644 ./rdjpgcom.1 /usr/local/man/man1/rdjpgcom.1
/usr/bin/install -c -m 644 ./wrjpgcom.1 /usr/local/man/man1/wrjpgcom.1


I hope this provides some further insite....

thanks,
Tsila


On 2/28/07, Hugo González Monteverde < hugonz-lists <at> h-lab.net> wrote:
Hi,

It looks like there is a capability you don't have installed in your
image processing lib. but you really give us nothing. Please tell us:

  - Was this working before in any other operating system or python version?
  - What module are you using for working with jpeg?
  - Show us the code that throws this exception, or how you use it..

And maybe we'll have some info to help you out.


Tsila Hassine wrote:
> Dear fellow Pythoneers,
>
> I have recently upgraded to Mac 10.4, and since then this error appears
> when trying to manipulate an image (resize it actually),
> can anyone help me out ?
>
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor


_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor
Bob Gailer | 1 Mar 03:29
Picon

Re: howto call DOM with python

Ismael Farfán Estrada wrote:
> hi there
>
> I was wondering wheter someone knows how to use python to write
> a client-side scripts like if it were java, I want to get someting like
> this working
> <html>
> <script type="text/python">
> window.alert("python")
> </script>
> </html>
>
> but nothing happens. I don't know javascript but this code works
> if I put javascript instead of python, I've also tried with pythonscript
> python-source, etc
>
> hope you can help me, I'm using GNU/Suse, Opera, and Firefox for test
>   
As others have pointed out, browsers only know JavaScript. But take a 
look at pyjamas: http://pyjamas.pyworks.org/ which translates Python 
into browser-specific JavaScript. It is designed around a Python port of 
Google Web Toolkit, but you don't need to use that aspect of it. Of 
course the ability to create web pages using the ported GWT widgets is 
pretty impressive. No more HTML!

Take a look at the pyjamas helloworld example.

--

-- 
Bob Gailer
510-978-4454

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

János Juhász | 1 Mar 08:01
Favicon

Re: howto call DOM with python

hi

there are same samples about it in the activepython 2.4 installation 
folder
c:\Python24\Lib\site-packages\win32comext\axscript\Demos\client\ie\
on my xp, but it isn't working. I have just repaired my activepython and 
reinstalled it but no success.

As I remenber, it was working under activepython 2.3 anyway.

Yours sincerely,
______________________________
János Juhász

> Date: Wed, 28 Feb 2007 15:40:59 -0600
> From: Hugo Gonz?lez Monteverde <hugonz-lists <at> h-lab.net>
> Subject: Re: [Tutor] howto call DOM with python
> To: tutor <at> python.org
> Message-ID: <45E5F6EB.30408 <at> h-lab.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed

> I too wish it worked. In javascript, it works because the browser has a
> Javascript implementation. There's no stock browser with a Python
> implementation, and I've looked for any client side implementation with
> no success.

> Hugo

> Ismael Farf?n Estrada wrote:
> > hi there
> >
> > I was wondering wheter someone knows how to use python to write
> > a client-side scripts like if it were java, I want to get someting 
like
> > this working
> > <html>
> > <script type="text/python">
> > window.alert("python")
> > </script>
> > </html>
> >
> > but nothing happens. I don't know javascript but this code works
> > if I put javascript instead of python, I've also tried with 
pythonscript
> > python-source, etc
> >
> > hope you can help me, I'm using GNU/Suse, Opera, and Firefox for test
> >
> > _________________________________________________________________
> > El mejor destino, con los mejores contenidos 
http://www.prodigy.msn.com
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor <at> python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Picon
Favicon

python problem

I have no idea how to even begin to program something like this and 
what I need to do is:
To complete the skeleton by replacing ellipsis (in this case vertical) 
with a  solution. The number of dot indicates the number of lines of 
the solution, and fill in the following dots:

def every_nth(s, n):
    """Return a string composed of every n_th character of s, starting from the
    first; that is, those characters with indices 0, 1*n, 2*n, ...

    >>> every_nth('abcdefg', 2)
    'aceg'
    >>> every_nth('abcdefg', 3)
    'adg'
    >>> every_nth('abcdefg', 1)
    'abcdefg'
    >>> every_nth('abcdefg', 20)
    'a'
    >>>
    """
    .
    .
    .
    .
    .
    .

def space_separate(s):
    """Return a copy of string s with a space inserted between each of the
    characters of string s.

    Use iteration over the characters of s.

    >>> assert space_separate('abc') == 'a b c'
    >>> assert space_separate('') == ''
    >>>
    """
    .
    .
    .
    .
    .
    .

def reverse(s):
    """Return a string with the characters of string s in reverse order.

    Implement with a while loop and indexing.

    >>> assert reverse('abc') == 'cba'
    >>> assert reverse('') == ''
    >>>
    """
    .
    .
    .
    .
    .
    .

def test():
    """Tests for this file."""
    # add a few tests for each function below using assert statements

if __name__ == '__main__':
    test()

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Kent Johnson | 1 Mar 16:54
Gravatar

Re: python problem

> 
> From: "Purcell,  Brittany Nicole" <bnpurcel <at> indiana.edu>
> Date: 2007/03/01 Thu AM 01:40:45 EST
> To: tutor <at> python.org
> Subject: [Tutor] python problem
> 
> I have no idea how to even begin to program something like this and 
> what I need to do is:
> To complete the skeleton by replacing ellipsis (in this case vertical) 
> with a  solution. The number of dot indicates the number of lines of 
> the solution, and fill in the following dots:

This looks like homework to me. We won't do your homework for you. We will answer questions and help you when
you have trouble but you have to try.

What have you learned so far in class? How might you apply that to these exercises?

Kent
> 
> def every_nth(s, n):
>     """Return a string composed of every n_th character of s, starting from the
>     first; that is, those characters with indices 0, 1*n, 2*n, ...
> 
>     >>> every_nth('abcdefg', 2)
>     'aceg'
>     >>> every_nth('abcdefg', 3)
>     'adg'
>     >>> every_nth('abcdefg', 1)
>     'abcdefg'
>     >>> every_nth('abcdefg', 20)
>     'a'
>     >>>
>     """
>     .
>     .
>     .
>     .
>     .
>     .
> 
> 
> def space_separate(s):
>     """Return a copy of string s with a space inserted between each of the
>     characters of string s.
> 
>     Use iteration over the characters of s.
> 
>     >>> assert space_separate('abc') == 'a b c'
>     >>> assert space_separate('') == ''
>     >>>
>     """
>     .
>     .
>     .
>     .
>     .
>     .
> 
> def reverse(s):
>     """Return a string with the characters of string s in reverse order.
> 
>     Implement with a while loop and indexing.
> 
>     >>> assert reverse('abc') == 'cba'
>     >>> assert reverse('') == ''
>     >>>
>     """
>     .
>     .
>     .
>     .
>     .
>     .
> 
> def test():
>     """Tests for this file."""
>     # add a few tests for each function below using assert statements
> 
> if __name__ == '__main__':
>     test()
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor <at> python.org
> http://mail.python.org/mailman/listinfo/tutor
> 

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Nagendra Singh | 1 Mar 17:18
Picon
Gravatar

Re: Problem with Import

Thanks for the suggestion, the Python path is correct. After a bit of experimenting I found out that it works with Python 2.3 but not 2.4 but I have no clue as to why.

Nagendra

On 2/28/07, Jalil <jalilsan <at> gmail.com> wrote:
check your python path

On 2/28/07, Nagendra Singh < singh01 <at> gmail.com> wrote:
Hi all,

I am running python on Cygwin and I have also installed gdal which is a raster translator library. When I run the command import gdal, Python gives me an error :

Python 2.4.3 (#1, May 18 2006, 07:40:45)
[GCC 3.3.3 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/site-packages/gdal.py", line 191, in ?
    import _gdal
ImportError: No module named _gdal

The file gdal.py and gdal.pyc are in : /usr/lib/python2.4/site-packages, but still it gives this error.

Thanks

Singh


_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor



_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor
Rikard Bosnjakovic | 1 Mar 17:19
Picon

Re: python problem

On 3/1/07, Purcell,  Brittany Nicole <bnpurcel <at> indiana.edu> wrote:
> I have no idea how to even begin to program something like this and
> what I need to do is:

We won't do your homework unless you atleast show that you are
interested in learning what you are doing, and not only going for
grade points.

--

-- 
- Rikard.
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Kent Johnson | 1 Mar 17:27
Gravatar

Re: python problem

> From: "Ted Roche" <tedroche <at> gmail.com>
> Sounds like A201 to me...
> 
> http://www.cs.indiana.edu/classes/a201/Syllabus.html

Yes, assignment 7 lab work
http://www.cs.indiana.edu/classes/a201/a/7/index.html

Kent

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Andreas Kostyrka | 1 Mar 18:49

Re: python problem

Why does that look like a homework to me? One where you are supposed to solve it by yourself?
 
Andreas
 
_____ Ursprüngliche Mitteilung _____
Betreff: [Tutor] python problem
Autor: "Purcell, Brittany Nicole" <bnpurcel <at> indiana.edu>
Datum: 1. März 2007 7:40:45
 
I have no idea how to even begin to program something like this and
what I need to do is:
To complete the skeleton by replacing ellipsis (in this case vertical)
with a solution. The number of dot indicates the number of lines of
the solution, and fill in the following dots:

def every_nth(s, n):
"""Return a string composed of every n_th character of s, starting from the
first; that is, those characters with indices 0, 1*n, 2*n, ...
>>> every_nth('abcdefg', 2)
'aceg'
>>> every_nth('abcdefg', 3)
'adg'
>>> every_nth('abcdefg', 1)
'abcdefg'
>>> every_nth('abcdefg', 20)
'a'
>>>
"""
.
.
.
.
.
.


def space_separate(s):
"""Return a copy of string s with a space inserted between each of the
characters of string s.

Use iteration over the characters of s.

>>> assert space_separate('abc') == 'a b c'
>>> assert space_separate('') == ''
>>>
"""
.
.
.
.
.
.

def reverse(s):
"""Return a string with the characters of string s in reverse order.

Implement with a while loop and indexing.
>>> assert reverse('abc') == 'cba'
>>> assert reverse('') == ''
>>>
"""
.
.
.
.
.
.

def test():
"""Tests for this file."""
# add a few tests for each function below using assert statements

if __name__ == '__main__':
test()


_______________________________________________
Tutor maillist - Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor
Chris Hengge | 1 Mar 23:30
Picon

Re: httpd in your laptop?!? serve web pages and wikis in your notebook?

I was using Abyss web server for a long time since it has multi-OS support and a friendly web based UI for administration. Seemed extremely light weight to me.

On 2/27/07, Luke Paireepinart <rabidpoobear <at> gmail.com> wrote:
Kirk Bailey wrote:
> ok, I realized  SOME TIME BACK that to run MANY THINGS in your windows
> computer you need a server in there- and a nice SMALL one if it is going
> to coexist with everything else going on.
You need a server for what now?
Web pages?  FTP? SVN?
I can't think of much else.

I run apache and ftp services on my windows machine, and they're
using... let me check...
4 MB of ram for the FTP server, and 4.6 MB of ram for Apache.  neither
of these are considered 'lightweight' apps.  Both are fully-featured.
Neither are listed as using more than 0% CPU.
My IM client uses 14 MB, my music program uses 32 MB, my browser is
using 63 MB, and my e-mail client is using 47 MB.
I would consider Apache fairly resource-friendly, compared to these
other apps.  Not to mention it's used on over 50% of EVERY web server,
so I'm pretty sure it's reliable.  And I don't see a need to use
anything else.  If your software asked me to install some obscure web
server I've never heard of, I would probably cancel the installation and
forget about it, for fear it would interfere with my already-established
Apache server.
>  I found one in python, and
> posted it, and it caused a stirr.
I don't know what you're referring to, maybe it was before I joined the
list.
>  Well, I found a LISTING of them, and
> tried all the more promising ones. here is that page:
> http://microsoft.toddverbeek.com/phttpd.html
>
Can I ask why are you looking into this?
As far as I can tell, the software you're writing (miniwiki) will be
served from the client's computer directly to the client's web
browser.  No actual web stuff is necessary, right?
I don't understand why you'd want to make the user have to install
another webserver to use your program.  You're writing it in Python, why
not use a Python HTTP server library, and have that included in your
distribution when you py2exe it?
It seems by far a better solution.

JMO,
-Luke

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Gmane