#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    616
    Rep Power
    65

    Smile Python vs Javascript


    I know you can use Python as a scripting language instead of javascript for your web-browser's html files. For some odd reason I lost all the original information on this. Can anybody help me in refreshing my memory.
  2. #2
  3. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    No, you can't replace (client-side) javascript with Python. You can replace a server-side language (PHP/Perl/Asp/*.Net) with Python

    --Simon
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    Originally Posted by SimonGreenhill
    No, you can't replace (client-side) javascript with Python. You can replace a server-side language (PHP/Perl/Asp/*.Net) with Python

    --Simon
    Simon is exactly right, you cannot use it as a client side scripting language like javascript.

    Sorry simon I would have given you some points for it but it wont let me, i guess my 3 really wouldn't have made to much of a differance anyway..lol

    Comments on this post

    • SimonGreenhill agrees : I'm not exactly hurting for points, eh? :D
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Location
    The Holographic Universe
    Posts
    75
    Rep Power
    10
    Originally Posted by Dietrich
    I know you can use Python as a scripting language instead of javascript for your web-browser's html files. For some odd reason I lost all the original information on this. Can anybody help me in refreshing my memory.
    Well I have read about this too. You can use Mark Hammonds Win32 extensions to allow you to use Python as a client-side scripting language in Internet Explorer. Also the Grail browser lets you use Python for client-side scripting and even applets. Searching on usenet turns up quite a few results: comp.lang.python

    Comments on this post

    • SimonGreenhill agrees : well, you learn something every day :) Thanks!
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    Originally Posted by Markup
    Well I have read about this too. You can use Mark Hammonds Win32 extensions to allow you to use Python as a client-side scripting language in Internet Explorer
    This used to be true in earlier versions of Python, which had a restricted execution mode (rexec module). This was removed in (I think) version 2.2, since changes to the language made it insecure. You would also need the user to have Python installed, which would severely limit the audience for your website.

    However it may be possible to use py2exe to create a python ActiveX plugin, since this is essentially a COM server. I have never done it though, so I don't know how much work it would involve or even if it is possible. It would also limit the audience to people who use IE and are dumb enough to give websites total control of their PC (admittedly that's a lot of people).

    Dave
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Posts
    78
    Rep Power
    10
    Grail has joined the choir eternal - last release was five years back, probably for 1.5.2, and the last CVS update was 4 years back...

    mochikit is a new javascript library to make javascript a little more Pythonic.

    There's also ming, which allows you to code for Shockwave Flash in Python

    --OH.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    85
    Rep Power
    10
    Originally Posted by SimonGreenhill
    No, you can't replace (client-side) javascript with Python. You can replace a server-side language (PHP/Perl/Asp/*.Net) with Python

    --Simon
    ok so is it possible to make a forum wit python instead of php?
    if so how much work is involved...im still a newbie so reading material of sum sort of this python server-side programming wud do jus fine....or damn goood explainations lol ty
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    Originally Posted by Rc2001
    ok so is it possible to make a forum wit python instead of php?
    if so how much work is involved...im still a newbie so reading material of sum sort of this python server-side programming wud do jus fine....or damn goood explainations lol ty
    well yes actually, it is quite possible! I am doing that right now. Well actaully I am creating a whole web site out of python with mod_python. Forum included. My site: http://gurusnetwork.org/. I decided to go with python since i personly do not like php. I have used php for quite a few years and i just never have been happy. However with python I am having to make everything from scratch because there really isn't much done yet for python and web work, well publicly. If you would like to view my source code(its going to be released when my web site is a bit more operational anyway) just email or im me and i will happly get it together for you to look at.

    I think its probbaly a lot more involved than wiht php since with php there is a lot of code that has already been done. Like a bbcode translator, you can use anyones with your wbe site. I personly havn't found one yet for python except for the one i wrote. But its fun, if oyu like python then its even better. Its probably best if you can get a bit of help though, which i am always looking for, since there truly is just a lot of stuff to be done.

    However good luck if you need anything I feel I am getting pretty good with the psp handler.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    85
    Rep Power
    10
    indeed i will be lookin forward to seein ur page 1/2 done or complete but letme kno when ur done n ill check out ur source.

    is python harder then php when it comes to the forum.....and the output of it will it be similar to this forum or way dif

    ty 4reply
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    umm, i feel that it is easyer, but then again I am about 100x better at python than i am at php. I think it is a huge joice of option. I think that php has a lot more tools built in for just web work, while python you need to get things like mod_python or mysqldb and such to make it truely usfull. However that really isn't more work. Just part of the server set up proccess. It is also hard to find web hosts that offer mod_python, however one that I know of is http://cubichosting.net I know that because I use them as a mirror for my web site. I also run my own server at home because it truly is hard to find servers. But cubic hosting is a great host.

    The outcome can be however you want it, to get it this complex as the dev shed forum. But it is possible. This one is writen in php, but it can be done just the same in python, just depends on how you do it.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    85
    Rep Power
    10
    Originally Posted by CyBerHigh
    umm, i feel that it is easyer, but then again I am about 100x better at python than i am at php. I think it is a huge joice of option. I think that php has a lot more tools built in for just web work, while python you need to get things like.....
    ook ill have to look into that myself but ty

IMN logo majestic logo threadwatch logo seochat tools logo