473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Python with Ecmascript

Hello,

for my Python application (Windows platform) to be standards
compliant, I need to embbed Ecmascript(Javascript) interpreter - I
need to execute plugins written in this language. Which engine is
suitable for Python, I have found bunch of them. Any recomendations
are welcome.

To be more specific, I think that plugins will be pretty simple, they
will be used to manipulate my class-based datamodel, no special
libraries dependencies ... therefore I prefer some rather simple
solution ...

Jiri

Jul 5 '08 #1
14 1576
On Sat, 5 Jul 2008 06:28:42 -0700 (PDT), "ji***********@gmail.com"
<ji***********@gmail.comwrote:
Hello,

for my Python application (Windows platform) to be standards
compliant, I need to embbed Ecmascript(Javascript) interpreter - I
need to execute plugins written in this language. Which engine is
suitable for Python, I have found bunch of them. Any recomendations
are welcome.

To be more specific, I think that plugins will be pretty simple, they
will be used to manipulate my class-based datamodel, no special
libraries dependencies ... therefore I prefer some rather simple
solution ...
PyQt includes a Javascript interpreter. You can expose Python objects and
properties as Javascript objects and properties.

Phil

Jul 5 '08 #2
Hi!

Ecmascript (Jscript) is Active-Scripting compliant.
With PyWin32, you can :
- call JScript functions (with parameters)
- define pieces of code (& run it)

Another way, is to drive Internet-Explorer (via COM). You can set the
IE-Windows as invisible, and connect the motor of execution (of
JScript). Then, you can :
- call JScript functions, with parameters et return ; variables, but
also array (<=lists)
- connect to JScripts's objects (for read/write)
- write new functions in JScript
- etc.

@-salutations

Michel Claveau


Jul 5 '08 #3
Ecmascript (Jscript) is Active-Scripting compliant.
With PyWin32, you can :
- call JScript functions (with parameters)
- define pieces of code (& run it)

Another way, is to drive Internet-Explorer (via COM). You can set the
IE-Windows as invisible, and connect the motor of execution (of
JScript). Then, you can :
- call JScript functions, with parameters et return ; variables, but
also array (<=lists)
- connect to JScripts's objects (for read/write)
- write new functions in JScript
- etc.
Is there a way to do similar things on linux?

Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
Jul 5 '08 #4
"ji***********@gmail.com" <ji***********@gmail.comwrote:
>
for my Python application (Windows platform) to be standards
compliant, I need to embbed Ecmascript(Javascript) interpreter - I
need to execute plugins written in this language.
What standard are you hoping to comply with? I mean, what kind of a
program is this?
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 6 '08 #5
Hi!
Is there a way to do similar things on linux?
I think no. Because these tech use COM. And COM don't exist under xxnux.
But:
- look if XPCOM, or dBus) can help you
- search with the word "MOZLAB", who work a solution (plugin) for
drive Firefox, from an external software.

Good luck!
--
Michel Claveau

Jul 6 '08 #6
>Is there a way to do similar things on linux?
>
I think no. Because these tech use COM. And COM don't exist under xxnux.
But:
- look if XPCOM, or dBus) can help you
- search with the word "MOZLAB", who work a solution (plugin) for
drive Firefox, from an external software.
Wow, mozlab is amazing!

Thanks,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
Jul 6 '08 #7
On 6 Čec, 07:02, Tim Roberts <t...@probo.comwrote:
"jiri.zahra...@gmail.com" <jiri.zahra...@gmail.comwrote:
for my Python application (Windows platform) to be standards
compliant, I need to embbed Ecmascript(Javascript) interpreter - I
need to execute plugins written in this language.

What standard are you hoping to comply with? I mean, what kind of a
program is this?
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
Thats for our speech recognition server - it should executed "tags"
with Javascript code embbeded in some XML grammar format.

I personally does not like COM solution. I prefer some simple library
but may be it is just a hope. I will look to PyQT library and to
Mozilla scripting engine, but I think that this one can get
unnecessarily difficult.

Does anyone work or use something similar?

Jiri
Jul 6 '08 #8
On Jul 7, 12:31*am, "jiri.zahra...@gmail.com"
<jiri.zahra...@gmail.comwrote:
I personally does not like COM solution. I prefer some simple library
but may be it is just a hope.
Have you looked at the module 'python-spidermonkey'? It apparently
"allows for the implementation of Javascript classes, objects and
functions in Python, as well as the evaluation and calling of
Javascript scripts and functions".

http://code.google.com/p/python-spidermonkey/
Jul 7 '08 #9
On 7 Čec, 08:21, alex23 <wuwe...@gmail.comwrote:
On Jul 7, 12:31 am, "jiri.zahra...@gmail.com"

<jiri.zahra...@gmail.comwrote:
I personally does not like COM solution. I prefer some simple library
but may be it is just a hope.

Have you looked at the module 'python-spidermonkey'? It apparently
"allows for the implementation of Javascript classes, objects and
functions in Python, as well as the evaluation and calling of
Javascript scripts and functions".

http://code.google.com/p/python-spidermonkey/
I have looked at it. It seems to be not fully working version, but I
have not check it properly because the project homepage says "windows
version is forthcoming".

At this time I am considering using some command line interpreter
(maybe jsdb, http://www.jsdb.org/, based on spidermonkey) Idea is to
save script code to file and let it run by interpreter and then parse
the results. Problem is that this approach has very limited access to
variables and objects exposed to javascript (they needs to be
serialized before script run, script cannot call python functions etc)
and also retrieving results is not straigtforward.

Still looking for better solution ...

JZ
Jul 7 '08 #10
On Jul 7, 9:23*am, "jiri.zahra...@gmail.com" <jiri.zahra...@gmail.com>
wrote:
On 7 Čec, 08:21, alex23 <wuwe...@gmail.comwrote:
On Jul 7, 12:31 am, "jiri.zahra...@gmail.com"
<jiri.zahra...@gmail.comwrote:
I personally does not like COM solution. I prefer some simple library
but may be it is just a hope.


Still looking for better solution ...

JZ
How about using Jython and Rhino [http://www.mozilla.org/rhino/] ?
Could be worth your while, if you could live with coding for an older
version of the Python spec.

/sysprv
Jul 7 '08 #11
Daniel Fetchinson wrote:
Is there a way to do similar things on linux?
NJSModule?
http://en.wikipedia.org/wiki/NJS

Alan Isaac
Jul 10 '08 #12
>Is there a way to do similar things on linux?
>
NJSModule?
http://en.wikipedia.org/wiki/NJS
This seems to be very good indeed. Just downloaded njs but the only
njsmodule version I could find was for python 2.1. Does anyone have a
recent copy?

Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
Jul 10 '08 #13
>>NJSModule?
>>http://en.wikipedia.org/wiki/NJS

Daniel Fetchinson wrote:
This seems to be very good indeed. Just downloaded njs but the only
njsmodule version I could find was for python 2.1. Does anyone have a
recent copy?
1. You might ask here:
http://lists.njs-javascript.org/cgi-...listinfo/users

2. Did you try to compile it?
Is there anything obviously 2.5 incompatible?

Cheers,
Alan Isaac
Jul 11 '08 #14
>>>NJSModule?
>>>http://en.wikipedia.org/wiki/NJS
>This seems to be very good indeed. Just downloaded njs but the only
njsmodule version I could find was for python 2.1. Does anyone have a
recent copy?

1. You might ask here:
http://lists.njs-javascript.org/cgi-...listinfo/users

2. Did you try to compile it?
Is there anything obviously 2.5 incompatible?
Well, so far I couldn't even compile njs (./configure complains about
HOST setting or some such) so haven't looked at njsmodule yet.

Thanks for the suggestions!
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
Jul 11 '08 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: manno | last post by:
Hi all, more or less just out of curiosity... I had a short 'discussion' about JavaScript in different borwsers. The other guy said that there's differeces in JavaScript accross browsers (I...
12
by: Ali | last post by:
I have the following web page with a script in it. <html> <head> <title>Make Your Own Objects test</title> <script>
2
by: Lachlan Hunt | last post by:
Hi, In JavaScript 1.5, objects can use special getter and setter functions for properties. However, these only seem to be implemented in Gecko and, AFAICT, don't seem to be part of ECMAScript. ...
12
by: Simula | last post by:
Hello All, Does anyone have any knowledge of when version 4 will be released? I think that version 3 was finalized in 1999 and it would be really nice to have the class keyword and statically...
2
by: bissatch | last post by:
Hi, I am one of the many that get fed up with browser sniffing and cross platform issues. Is ECMAscript a new independant cross platform specification that can do loads of nice things that...
13
by: aum | last post by:
Hi, I'm a Python programmer, just starting to get into javascript. On reading some of the js guides, and not liking any of the OO usage patterns I saw, I've cooked up something which python...
2
by: VK | last post by:
2.12 What does the future hold for ECMAScript? <old> The fourth edition of ECMAScript will provide new features like typed variables, and classes. More information can be found at:...
34
by: dhtml | last post by:
I made a change to the FAQ of javascript to EcmaScript. I got some feedback that the newsgroup is CLJ and the language is commonly referred to as JavaScript. Therefore, the word in the FAQ...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - What is ECMAScript? ----------------------------------------------------------------------- ECMAScript is the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.