views:

563

answers:

8

If yes are there any frameworks/Tutorials/tips/etc recommended?

N00b at Python but I have tons of PHP experience and wanted to expand my skill set.

I know Python is great at server side execution, just wanted to know about client side as well.

+1  A: 

No. Browsers don't run Python.

Byron Whitlock
Why the down vote, its absolutely true? Show me a mainstream browser with a native python interpreter.
micmcg
I didn't vote you down, but other people have posted at least two ways to run Python within a browser, using additional code. Windows doesn't let you run Python without additional code, but you wouldn't say 'Windows doesn't run Python'
Will Dean
In the context of the original question, I think this is still the right answer. No sane developer would recommend TO A NEW DEVELOPER running python in the browser when there are so many better alternatives. Despite the hype, the browser isn't an os so you are constrained by available technology.
Byron Whitlock
+4  A: 

Python isn't really used for client side, because no major web browsers have Python built in.

However, Javascript has become more and more Python-like as it has evolved. You might want to study Python and Javascript together.

Take a look at https://developer.mozilla.org/en/New_in_JavaScript_1.7 and notice the Python-like nature of the new features. "array comprehensions" are just like Python list comprehensions; iterators and generators are straight out of Python; "destructuring assignments" are a standard Python idiom.

Javascript is kind of like Python with curly braces. It uses a very different inheritance model, but libraries are available that implement a more Python-like class system on top of the built-in system in Javascript.

steveha
+1  A: 

Edit: Python is available for the client: skulpt

If its client side your interested delve into JQuery as it's more fun to use :)

http://jqueryui.com/

Andi
Yeah I'm a big fan of jQuery, thnx
Phill Pafford
+10  A: 

Have you seen skulpt?

http://www.skulpt.org/

easement
Very good.. My first thought when i saw this question is. NO IT CAN RUN. I guess i was wrong.
Fábio Antunes
Well it can, it's just painfully slow.
Lennart Regebro
Use a javascript interpreter to write a python interpreter! BRILLANT! Well I bet it was fun to write at least.
Byron Whitlock
Well it's not that long ago that javascript was painfully slow. Javascript got better, CPUs got faster. Something like skulpt can work as a foot in the door. If clientside Python became popular enough the browsers would begin to support it natively
gnibbler
Skulpt looks like it could do something like I want in the future but it seems to be in the early Alpha stage right now. I will keep my eyes on it though, thnx
Phill Pafford
+6  A: 

You can use pyjamas to convert Python code to JS code that runs in the browser (note that pyjamas also offers much more). So YES, you can use Python for client side web development.

Pyjamas is basically a port of the Google Web Toolkit, which allows you to write client side code in Java.

nikow
But that's pretty much the same as python to generate HTML. Python is NOT on the client side. It is only used to generate client-side code, in this case js. So, I don't think it applies
OscarRyz
No, not really, but it helps. :)
Lennart Regebro
@Oscar: That's a bit like saying that C++ does not run on computers, because it is compiled to machine code first ;-)
nikow
@nikow: Well yes, everything could be assembler syntactic sugar in some sense. But in this particular example, you are definitely NOT running python in the client side. If that would be the case you'll need a python interpreter right? But the js generated has nothing to do with python ( in the same fashion js generated by GWT has very no java in it ) It does help, definitely.
OscarRyz
interesting, but just shy of what I'm looking for
Phill Pafford
+5  A: 

Silverlight can run IronPython, so you can make Silverlight applications. Which is client-side.

Lennart Regebro
I wanted to run this in the browser, thnx
Phill Pafford
Well, it's in the browser. But not in the same way as Javascript no. Man it would be great if we could use Python instead of JS. <dreams>
Lennart Regebro
+3  A: 

Have a look at this:

http://www.trypython.org/

It's an interactive python console + tutorial written with Silverlight+IronPython.

Will Dean
I wanted to run this in the browser
Phill Pafford
Is it in the browser - it's Python which can manipulate the DOM.
Will Dean
A: 

Noone has mentioned it yet, but grail is/was pretty cool http://en.wikipedia.org/wiki/Grail%5F%28web%5Fbrowser)

"Grail was a free extensible multi-platform web browser written in the Python programming language. The project was started in August 1995, with its first public release in November of that year. [1] The .3 beta contained over 27,000 lines of Python.[1] Its last release was of version 0.6 in 1999, with latest version under development."

gnibbler
Thanks will check it out.BTW your link is broken, missing the closing ).
Phill Pafford