Does Pyjs support Python 3?

680 views
Skip to first unread message

wb

unread,
May 26, 2015, 3:54:36 AM5/26/15
to pyjs-...@googlegroups.com
Hi,

I am having a lot of troubles with unicode conversion using Python 2.7 and Pyjs. So, I am thinking about moving from Python 2 to Python 3.  Unicode is the default encoding in Python 3 and Javascript. So I am hoping that the unicode conversion is not necessary in Pyhon 3 and Pyjs usage.

Does Pyjs support Python 3? Is there anyone who tried this?

Thanks in advance


Adrien

unread,
May 26, 2015, 4:29:36 AM5/26/15
to pyjs-...@googlegroups.com
Hi,

On 05/26/2015 09:54 AM, wb wrote:
> Does Pyjs support Python 3? Is there anyone who tried this?

we have the same concern for our project Salut à Toi. One of our dev
wrote about it a few days ago [1]:

> We have 2 main blocking issues to move to Python 3:
>
> [...]
>
> - Pyjamas: which is not maintained anymore, and anyway was planing to
> stay on Python 2. We are looking for an alternative (even thinking
> about building our own), but it will take a while before a good
> solution is available.
>
> [...] For Pyjamas we have little hope to see it
> become active again, and no hope at all to see it moving to Python 3,
> so we'll have to find alternative anyway.

This is the sad truth... or someone here has better news?

Cheers,
Adrien

[1] http://lists.goffi.org/pipermail/dev/2015-May/000241.html

Glyph Lefkowitz

unread,
May 26, 2015, 6:36:22 PM5/26/15
to pyjs-...@googlegroups.com
I have moved all of my PyJS development over to Brython, which is only on python 3 :-), so that may be a way forward.

Also, I notice that the message you're citing calls out Twisted... which is approaching half of its lines covered on py3: https://twitter.com/hawkieowl/status/603041912770015234

-glyph

wb

unread,
Jun 11, 2015, 10:35:06 PM6/11/15
to pyjs-...@googlegroups.com
2015년 5월 27일 수요일 오전 7시 36분 22초 UTC+9, Glyph Lefkowitz 님의 말:
I have moved all of my PyJS development over to Brython, which is only on python 3 :-), so that may be a way forward.

-glyph

Is it possible to build a standalone desktop application in Brython? I need a cross-platfrom solution for both web and desktop environments. 

Glyph

unread,
Jun 11, 2015, 11:53:56 PM6/11/15
to pyjs-...@googlegroups.com
Since it's just a web page, you could probably distribute it with something like http://code.tutsplus.com/tutorials/introduction-to-html5-desktop-apps-with-node-webkit--net-36296 :)

-g

wb

unread,
Jun 21, 2015, 1:05:46 PM6/21/15
to pyjs-...@googlegroups.com
Thanks for letting me know about Brython. I studied it for a while, and I had impression that it didn't provide Model-View-Controller structure because it's main goal is to replace Javascript with Python (Please correct me if I am wrong). I think that simply replacing javascript syntax is not really (and not fully) Pythonic. 

Below is an example from Brython site. As you can see, the button id is inside html code, and its event controller is in Brython code. It make really difficult to read, and it is one of the reason why javascript is horrible in readability. 

<html>
<head>
<script src="/brython.js"></script>
</head>
<body onload="brython()">
<script type="text/python">
from browser import document, alert
def echo(ev):
    alert(document["zone"].value)
document['mybutton'].bind('click',echo)
</script>
<input id="zone"><button id="mybutton">click !</button>
</body>
</html>

I think that not only javascript but also html code all together should be replaced with Python to be fully pythonic. I am really happy with using Pyjs because I am writing quite a large web applications without html code, and Pyjs's Model-View-Controller structure really helps me write clean and reusable code. Brython might be developing further toward Model-View-Controller structure in the future, but I am worrying that rewritting my code to Brython right now is quite a huge job and the end results become worse in readability and reusability.

Reply all
Reply to author
Forward
0 new messages