Re: [Tutor] howto call DOM with python

2007-02-28 Thread János Juhász
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 <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] howto call DOM with python
> To: tutor@python.org
> Message-ID: <[EMAIL PROTECTED]>
> 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
> > 
> > 
> > window.alert("python")
> > 
> > 
> >
> > 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@python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] howto call DOM with python

2007-02-28 Thread Bob Gailer
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
> 
> 
> window.alert("python")
> 
> 
>
> 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@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] "IOError: decoder jpeg not available"

2007-02-28 Thread Tsila Hassine

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 <[EMAIL PROTECTED]> 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 "", 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 <[EMAIL PROTECTED]> 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@python.org
> http://mail.python.org/mailman/listinfo/tutor
>


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] "IOError: decoder jpeg not available"

2007-02-28 Thread Tsila Hassine

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 "", 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 <[EMAIL PROTECTED]> 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@python.org
http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] howto call DOM with python

2007-02-28 Thread Hugo González Monteverde
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
> 
> 
> window.alert("python")
> 
> 
> 
> 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@python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] "IOError: decoder jpeg not available"

2007-02-28 Thread Hugo González Monteverde
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@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Two sys.exit questions

2007-02-28 Thread David Perlman
If you want to play around with this stuff, you can first import sys,  
and then insert this line in the except clause:
print repr(sys.exc_info())
(or some other way of getting the details out of the returned tuple.)

That will tell you exactly what brought you to the except clause.

On Feb 28, 2007, at 12:07 PM, Jason Massey wrote:

> When you call sys.exit() you're raising a SystemExit exception.
>
> >>> help(sys.exit)
> Help on built-in function exit in module sys:
>
> exit(...)
> exit([status])
>
> Exit the interpreter by raising SystemExit(status).
> If the status is omitted or None, it defaults to zero (i.e.,  
> success).
> If the status is numeric, it will be used as the system exit  
> status.
> If it is another kind of object, it will be printed and the system
> exit status will be one (i.e., failure).
>
> So that explains why you're falling through to except clause.
> You can see the same type of behavior if you manually raise an  
> exception (ValueError for example) within a try clause
>
> In your example concerning the reading and writing to files, as far  
> as a close() statement goes you would get this error:
> >>> try:
> ... i_file = open('doesnt_exit.tmp','r')
> ... except IOError:
> ... i_file.close()
> ...
> Traceback (most recent call last):
>   File "", line 4, in ?
> NameError: name 'i_file' is not defined
> >>>
>
> Since i_file never got defined because the open wasn't successful.
>
> BTW don't use file as a variable since it will mask python's built- 
> in file object
>
> On 2/28/07, Cecilia Alm <[EMAIL PROTECTED]> wrote:I have two quick  
> questions:
>
> 1) Why does sys.exit() not work in a try clause (but it does in the  
> except clause)?
>
> >>> try:
> ...print 1
> ...sys.exit(0)
> ... except:
> ...print 2
> ...sys.exit(0)
> ...
> 1
> 2
> # python exited
>
> 2) If opening a file fails in the below 2 cases, sys.exit(message)  
> prints a message in the except clause before program termination.
> Some use file.close() in the except clause (or in a finally  
> clause). It seems superflous in the below case of read and write. (?)
>
> try:
> file = open('myinfile.txt', 'r')
> except IOError:
> sys.exit('Couldn't open myinfile.txt')
>
> try:
> file = open('myoutfile.txt', 'w')
> except IOError:
> sys.exit('Couldn't open myoutfile.txt')
>
>
>
>
>
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

--
-dave
Science arose from poetry... when times change the two can meet again
on a higher level as friends. -Göthe


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] howto call DOM with python

2007-02-28 Thread Jerry Hill
On 2/28/07, Ismael Farfán Estrada <[EMAIL PROTECTED]> wrote:
> I was wondering wheter someone knows how to use python to write
> a client-side scripts like if it were java

I don't think this is possible, at least without creating a
custom-compiled version of Firefox.

There's a little bit of discussion from last year on the python
mailing list here:
http://mail.python.org/pipermail/python-list/2006-November/415805.html

There's some more information available out there if you search for
PyXPCOM or python and nsdom.  If you do end up getting it working, I
would be interested in hearing how it went.

-- 
Jerry
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Problem with Import

2007-02-28 Thread Jalil

check your python path

On 2/28/07, Nagendra Singh <[EMAIL PROTECTED]> 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 "", 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@python.org
http://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Two sys.exit questions

2007-02-28 Thread Luke Paireepinart
[snip]
>
> (Although, I'm not sure what you meant by "working" in the below case, 
> since your example doesn't exit the interpreter.)
> [snip]
>
>
> try:
>f = file('somefile_you_have.txt','r')
>sys.exit(0)
>
> except IOError:
>print "You had an error on file input"
>
It would if you had a file named 'somefile_you_have.txt' in the same 
working directory as your python interpreter is set to.
If you don't, the f = file( ... ) line will fail to find the file to 
open for input, so it will throw an IOError and print out
"You had an error on file input"
If you do have such a file, the assignment to f will pass successfully, 
sys.exit will throw a SystemExit, and the except block won't catch it 
because it only catches IOErrors.

HTH,
-Luke

P.S. Please use the reply-all button so your replies go to the list and 
not to me.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] howto call DOM with python

2007-02-28 Thread Ismael Farfán Estrada
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


window.alert("python")



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@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] howto filter access to a cgi script

2007-02-28 Thread Kent Johnson
[EMAIL PROTECTED] wrote:
> Hi!
> 
> I have some python CGI scripts in an intranet, in a windows network, I  
> would like to restrict the access to some of those scripts to a list  
> of computers in the domain.
> 
> How?

Within the CGI I think you can look at the environment variable 
REMOTE_HOST or REMOTE_ADDR.

You could also do this by configuring the web server (e.g. apache) that 
is serving the CGI, or some other method of restricting access to the 
computer running the server.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Two sys.exit questions

2007-02-28 Thread Luke Paireepinart
Cecilia Alm wrote:
> I have two quick questions:
>
> 1) Why does sys.exit() not work in a try clause (but it does in the 
> except clause)?
sys.exit raises an exception.  That's how it exits program execution.
If you use it in a try block, the exception it raises will have no 
effect because your except clause isn't catching
a particular kind of error, it's catching all errors (including 
"SystemExit" ones)

an example of a sys.exit working in a try block would be something like 
this:

import sys
try:
   f = file('somefile_you_have.txt','r')
   sys.exit(0)

except IOError:
   print "You had an error on file input"


hope that clears some things up for you.
-Luke
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Problem with Import

2007-02-28 Thread Nagendra Singh

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 "", 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@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Two sys.exit questions

2007-02-28 Thread Jason Massey

When you call sys.exit() you're raising a SystemExit exception.


help(sys.exit)

Help on built-in function exit in module sys:

exit(...)
   exit([status])

   Exit the interpreter by raising SystemExit(status).
   If the status is omitted or None, it defaults to zero (i.e., success).
   If the status is numeric, it will be used as the system exit status.
   If it is another kind of object, it will be printed and the system
   exit status will be one (i.e., failure).

So that explains why you're falling through to except clause.
You can see the same type of behavior if you manually raise an exception
(ValueError for example) within a try clause

In your example concerning the reading and writing to files, as far as a
close() statement goes you would get this error:

try:

... i_file = open('doesnt_exit.tmp','r')
... except IOError:
... i_file.close()
...
Traceback (most recent call last):
 File "", line 4, in ?
NameError: name 'i_file' is not defined




Since i_file never got defined because the open wasn't successful.

BTW don't use file as a variable since it will mask python's built-in file
object

On 2/28/07, Cecilia Alm <[EMAIL PROTECTED]> wrote:


I have two quick questions:

1) Why does sys.exit() not work in a try clause (but it does in the except
clause)?

>>> try:
...print 1
...sys.exit(0)
... except:
...print 2
...sys.exit(0)
...
1
2
# python exited

2) If opening a file fails in the below 2 cases, sys.exit(message) prints
a message in the except clause before program termination.
Some use file.close() in the except clause (or in a finally clause).
It seems superflous in the below case of read and write. (?)

try:
file = open('myinfile.txt', 'r')
except IOError:
sys.exit('Couldn't open myinfile.txt')

try:
file = open('myoutfile.txt', 'w')
except IOError:
sys.exit('Couldn't open myoutfile.txt')







___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] howto filter access to a cgi script

2007-02-28 Thread paulino1
Hi!

I have some python CGI scripts in an intranet, in a windows network, I  
would like to restrict the access to some of those scripts to a list  
of computers in the domain.

How?

Thanks, Paulino
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Two sys.exit questions

2007-02-28 Thread Cecilia Alm

I have two quick questions:

1) Why does sys.exit() not work in a try clause (but it does in the except
clause)?


try:

...print 1
...sys.exit(0)
... except:
...print 2
...sys.exit(0)
...
1
2
# python exited

2) If opening a file fails in the below 2 cases, sys.exit(message) prints a
message in the except clause before program termination.
   Some use file.close() in the except clause (or in a finally clause). It
seems superflous in the below case of read and write. (?)

   try:
   file = open('myinfile.txt', 'r')
   except IOError:
   sys.exit('Couldn't open myinfile.txt')

   try:
   file = open('myoutfile.txt', 'w')
   except IOError:
   sys.exit('Couldn't open myoutfile.txt')
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Running an exe from Python

2007-02-28 Thread Nagendra Singh

Thanks a lot for all you helps. Alan your tutorial is very helpful But I
have another problem which I will post soon.

On 2/26/07, Alan Gauld <[EMAIL PROTECTED]> wrote:



"Nagendra Singh" <[EMAIL PROTECTED]> wrote

> Thanks a lot for all the suggestions. I used the function
> subprocess.call ( 'c:\abc.exe  c:\data\file1'), but as before
> the command window opens and closes very fast
> a value of 1 is displayed. How do I see the results??

The result is 1 which indicates an error. You don't want
the result you want the outpur, which is a different thing
entirely! :-)

To get the output you need to access the output stream
of the process which is usually stdout. The old way to do
that was with os.popen, but the subprocess module
provides a new way. The m,odule docs describe how
to replace popen using subprocess' Popen class.

My tutorial shows an example of the same thing based
on the odule documentation.

Basically it looks like:

import subprocess
psout = subprocess.Popen(r'c:\abc.exe c:\data\file1',
shell=True, stdout=PIPE).stdout
results = psout.read().split('\n')
Notice I enclosed the command with a raw string.Otherwise your
backslashes get treated as escape characters. This might be why you
are getting error codes back?Another way to avoid that is to use
forward slashes which Python understands on DOS psout =
subprocess.Popen('c:/abc.exe c:/data/file1',
shell=True, stdout=PIPE).stdout
> I am sorry if I sound dumb.

Nope, just looking for the wrong thing. But you only
know that after you find out :-)

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] "IOError: decoder jpeg not available"

2007-02-28 Thread Tsila Hassine

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 ?

thanks!
Tsila
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] question about forwarding mail with poplib

2007-02-28 Thread shawn bright
Hello there all,

i am poplib to retrieve mail from a pop server here on my local machine.
i need to be able to forward every message i get to another email address.
i looked through the poplib page on the reference online but i can't
find anything there to help me out with this. Also, the message has a
64bit encoded attachment.

anyone have a tip on how i should proceed with this ?

thanks.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] MiniWiki

2007-02-28 Thread Kirk Bailey
It's a result problem; I do not see the reason it is doing this. AS I do 
not yet understand it, I cannot say where the problem is. Anyone got an 
idea?

I am posting musings and rumbling about my project so anyone who is 
interested may offer suggestions, or simply follow along for their own 
interest and amusement. Who knows, maybe someone will spark an idea off 
of it and gain something.

Kent Johnson wrote:
> Kirk Bailey wrote:
>> OK, 1.3.0 is coming along well, and works pretty nice. BUT...
>>
>> It lives inside my laptop, and I want to be able to duck out and go 
>> back to the regular webpages I put into it. Remember, I have a server 
>> in there, tinyweb. So there it is, working well, and I put in a link 
>> to referr back to localhost:
>> http://localhost/index.html
>>
>> And it goes banannas, misprocessing the link construction. BUT, when I 
>> look it over with a normal link:
>> http://www.tinylist.org/
>> It processes fine. hmmm... Not seeing it yet, and I know, it's right 
>> there in front of me- somewhere...
> 
> Is that a question? If so, what do you mean by "it goes banannas, 
> misprocessing the link construction"? Is this a Python problem or a link 
> problem?
> 
> Kent
> 
> 

-- 
Salute!
-Kirk Bailey
   Think
  +-+
  | BOX |
  +-+
   knihT

Fnord.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Telnet and special characters

2007-02-28 Thread David Perlman
This question isn't well posed.  There is no such thing as an F1  
"character".

Data is sent over telnet connections as 8-bit bytes.  You can send  
any combination of 8-bit bytes you want by coding them in a number of  
different ways, such as chr(xx) like you wrote below, or '\xnn' or  
whatever suits your fancy.  The reason you are having problems is  
that you don't know what bytes you want to send over the connection.   
If you figure that out, then you will be able to send those bytes  
without any further trouble.

If you're having trouble figuring out what bytes you want to send  
over the connection, you need to take a step back and ask what it is  
you're actually trying to do.  What are you sending the data to?  Are  
you trying to emulate something else that would normally be sending  
the data?  Find the documentation for the sending and/or receiving  
ends, and figure out what combinations of characters, escape  
sequences, whatever, are involved in triggering the behavior that you  
want.  Then you will know what bytes you want to send.

If you are emulating something else on the client end, you could fire  
up the regular client and sniff the connection while you hit whatever  
'F1' key you're interested in, and see what actually gets sent over  
the connection when you do that.

On Feb 27, 2007, at 12:08 PM, Chris Hallman wrote:

>
> Is it possible to send a F1 "character" over a telnet connection?  
> I've searched but I can't find a solution. I've tried SendKeys and  
> other methods, but I can't get it to work.
>
> import telnetlib
>
> pswd = "***"
> host = "***"
> tn = telnetlib.Telnet(host)
> tn.read_until("password:", 7)
> tn.write(pswd + "\n")
> tn.write(chr(27)) # ESC
> tn.write (chr(78)) # Shift N
> tn.write(chr(25)) # Down arrow
>
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

--
-dave
After all, it is not *that* inexpressible.
-H.H. The Dalai Lama



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Telnet and special characters

2007-02-28 Thread Johan Geldenhuys
 I have used special characters before in Telnet sessions, but always use
hex characters. i.e.: \x0B for ESC.

Maybe F-keys are some form of internal OS signals and are not send out on
the network connection. In that case, I'm not sure how to send it.

Johan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Luke Paireepinart
Sent: 27 February 2007 09:57 PM
To: Chris Hallman
Cc: tutor@python.org
Subject: Re: [Tutor] Telnet and special characters

Chris Hallman wrote:
>
> Is it possible to send a F1 "character" over a telnet connection? I've 
> searched but I can't find a solution. I've tried SendKeys 
>  and other methods, but I 
> can't get it to work.
>
> import telnetlib
>
> pswd = "***"
> host = "***"
> tn = telnetlib.Telnet(host)
> tn.read_until("password:", 7)
> tn.write(pswd + "\n")
> tn.write(chr(27)) # ESC
> tn.write (chr(78)) # Shift N
> tn.write(chr(25)) # Down arrow
You could have a special sequence of characters that wouldn't normally be
used, like \1\1\2\3\1\2\4, and if the server receives this, you can use
pyHook or something to generate a keypress on the other end.
It seems to me that the function keys would have a value too.
I don't have time to investigate the matter further currently, I'll try to
look into it later.
-Luke
>
>
> --
> --
>
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>   

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.3/698 - Release Date: 2007/02/23
04:39 AM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.4/703 - Release Date: 2007/02/26
02:56 PM
 

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] MiniWiki

2007-02-28 Thread Kent Johnson
Kirk Bailey wrote:
> OK, 1.3.0 is coming along well, and works pretty nice. BUT...
> 
> It lives inside my laptop, and I want to be able to duck out and go back 
> to the regular webpages I put into it. Remember, I have a server in 
> there, tinyweb. So there it is, working well, and I put in a link to 
> referr back to localhost:
> http://localhost/index.html
> 
> And it goes banannas, misprocessing the link construction. BUT, when I 
> look it over with a normal link:
> http://www.tinylist.org/
> It processes fine. hmmm... Not seeing it yet, and I know, it's right 
> there in front of me- somewhere...

Is that a question? If so, what do you mean by "it goes banannas, 
misprocessing the link construction"? Is this a Python problem or a link 
problem?

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Three days left for Zope3 boot camp registration

2007-02-28 Thread Chris Calloway
Registration ends Friday:

http://trizpug.org/boot-camp/camp5

-- 
Sincerely,

Chris Calloway
http://www.seacoos.org
office: 332 Chapman Hall   phone: (919) 962-4323
mail: Campus Box #3300, UNC-CH, Chapel Hill, NC 27599



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] origin of the name python

2007-02-28 Thread Rikard Bosnjakovic
On 2/27/07, Doug Stone <[EMAIL PROTECTED]> wrote:

> Hi.  I just started investigating Python and was wondering about the origin
> of Python's name.
> What did van Rossum have in-mind when he named Python?

http://en.wikipedia.org/wiki/Guido_van_Rossum

About the origin of Python, Van Rossum wrote in 1996:

Over six years ago, in December 1989, I was looking for a "hobby"
programming project that would keep me occupied during the week around
Christmas. My office ... would be closed, but I had a home computer,
and not much else on my hands. I decided to write an interpreter for
the new scripting language I had been thinking about lately: a
descendant of ABC that would appeal to Unix/C hackers. I chose Python
as a working title for the project, being in a slightly irreverent
mood (and a big fan of Monty Python's Flying Circus).


-- 
- Rikard.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor