Re: [Tutor] howto call DOM with python

2007-03-03 Thread Alan Gauld

Alan Gauld [EMAIL PROTECTED] wrote 
 You will be better learing the minimum of
 JavaScript IMHO. 

I meant to add that you can make JavaScript more 
Pythonic, if thats an issue, by using mochikit.

http://mochikit.com/

Mochikit provides JavaScript functions that replicate 
many Python idioms in JavaScript.

HTH

-- 
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


Re: [Tutor] howto call DOM with python

2007-03-02 Thread Tim Golden
Alan Gauld wrote:

 You can do that in Internet Explorer provided you
 a) Have the winall package installed and

Just an aid to newcomers: the winall package
referred to here are the windows-oriented
extension modules by Mark Hammond which used to
be known as win32all and are now known as pywin32:

   http://pywin32.sf.net

TJG


(Sorry, Alan, just that searching for python winall
didn't yield entirely helpful results)
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] howto call DOM with python

2007-03-02 Thread ALAN GAULD
Thanks for the update Tim. 
I haven't downloaded the package in a while since
I've been using ActiveStates version on my Windows box 
which includes the extensions in the bundle.

Alan g.


- Original Message 
From: Tim Golden [EMAIL PROTECTED]
To: Alan Gauld [EMAIL PROTECTED]
Cc: tutor@python.org
Sent: Friday, 2 March, 2007 9:13:17 AM
Subject: Re: [Tutor] howto call DOM with python

Alan Gauld wrote:

 You can do that in Internet Explorer provided you
 a) Have the winall package installed and

Just an aid to newcomers: the winall package
referred to here are the windows-oriented
extension modules by Mark Hammond which used to
be known as win32all and are now known as pywin32:

   http://pywin32.sf.net

TJG


(Sorry, Alan, just that searching for python winall
didn't yield entirely helpful results)








___ 
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at 
the Yahoo! Mail Championships. Plus: play games and win prizes. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] howto call DOM with python

2007-03-02 Thread Ismael Farfán Estrada

I don't think you can make it work under Linux. The Jython applet
is your nearest option. You will be better learing the ninimum of
JavaScript IMHO. Try my tutorial as a quickl way in, especially
if you know Python...

Finally, you may be able to do what you want using the urllib
module to replace the browser entirely!

http://www.freenetpages.co.uk/hp/alan.gauld


By any chance is this your tutorial?
http://www.freenetpages.co.uk/hp/alan.gauld
I entered there but the parts Writing web clients and Writing
Web Applications are dissabled

Maybe you can send the direct ling to how to use that jython
applet, I'll give it a try. And now that we are here mabe a tutorial
for DOM to, I entered to the page of DOM but I found no
downloadable tutorial or a reference manual


Tanks for your time

_
Te gusta estar en control, crea tu propia experiencia en Internet 
http://live.com

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


Re: [Tutor] howto call DOM with python

2007-03-02 Thread Alan Gauld
Ismael Farfán Estrada [EMAIL PROTECTED] wrote

 By any chance is this your tutorial?
 http://www.freenetpages.co.uk/hp/alan.gauld

Yes that's it.

 I entered there but the parts Writing web clients and Writing
 Web Applications are dissabled

I'm writing them at the moment. :-)

But the early two sections of the tutorial teach the basics
of JavaScript, comparing it to Python.

 Maybe you can send the direct ling to how to use that jython
 applet,

There is a Jython community out there who can do that better
than me, but basically you just write an applet in Jython then
link to it from your web page. The browser will download it
and run it in the JVM. The biggest challenge is passing data
between the web page (DOM) and the applet - that is where
JavaScript scores.

HTH,

-- 
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


Re: [Tutor] howto call DOM with python

2007-03-01 Thread Alan Gauld
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 want to get someting 
 like
 this working
 html
 script type=text/python
 window.alert(python)
 /script
 /html

You can do that in Internet Explorer provided you
a) Have the winall package installed and
b) Have turned on Activce Scripting so that Pythonm is
recognised as a language

 but nothing happens. I don't know javascript but this code works
 if I put javascript instead of python,

JavaScript is built in to most browsers (and VBScript is built into 
IE)
Any other scripting languages will need to be installed on the
target users machine. That is quite unlikely on the web so
most folks stick to JavaScript for browser based scripting.

Java applets will run if a JVM is installed (which it usually is)
and so you can write applets in Jython and compile them to
JVM code and they will work too.

 I've also tried with pythonscript python-source, etc

No, it has to be a valid interpreter. But the interpreter must also
be installed in the browser...

 hope you can help me, I'm using GNU/Suse, Opera, and Firefox for 
 test

I don't think you can make it work under Linux. The Jython applet
is your nearest option. You will be better learing the ninimum of
JavaScript IMHO. Try my tutorial as a quickl way in, especially
if you know Python...

Finally, you may be able to do what you want using the urllib
module to replace the browser entirely!

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


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


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