-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tool to convert Python Mode .pyde code for use with pyp5js #45
Comments
@villares I was thinking if, by doing that, we're not giving ourselves some problems in the future... I'm basing my thought on your experience with you recent port from Pyprocessing to pyp5js. You had some issues with how Py2 handles numbers division differently from Py3, since py2 returns an integer while py3 returns a float as explained by the following snippet:
And this is just one of the many differences between the python versions... So, I think we have to assume that there could be other errors from this same nature when porting sketches and we have to take under consideration that, maybe, the people porting them aren't that familiar with such Python's versions details. Given that, I think it's very possible and reasonable for them to open issues on pyp5js that aren't related with the lib, but with the change on the python version. Speaking as the project maintainer, this could be a little bit overwhelming for me if it really happens. So, I'll put that on hold for now until we have more port examples and until we can confirm that these issues with the version update are indeed happening. |
Well, ok...
Or implement as an undocumented feature ;)
And make it print a BIG warning: EXPERIMENTAL! You are converting
incompatible Python 2 code. DO NOT EXPECT THIS TO WORK
…On Tue, 28 May 2019, 08:55 Bernardo Fontes, ***@***.***> wrote:
@villares <https://github.com/villares> I was thinking if, by doing that,
we're not giving ourselves some problems in the future... I'm basing my
thought on your experience with you recent port
<https://twitter.com/villares/status/1133164823632580608> from
Pyprocessing to pyp5js.
You had some issues with how Py2 handles numbers division differently from
Py3, since py2 returns an integer while py3 returns a float as explained by
the following snippet:
***@***.*** ~]$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
>>> type(3 / 3)
<class 'float'>
***@***.*** ~]$ python2
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
>>> type(2 / 2)
<type 'int'>
And this is just one of the many differences between the python versions...
So, I think we have to assume that there could be other errors from this
same nature when porting sketches and we have to take under consideration
that, maybe, the people porting them aren't that familiar with such
Python's versions details. Given that, I think it's very possible and
reasonable for them to open issues on pyp5js that aren't related with the
lib, but with the change on the python version.
Speaking as the project maintainer, this could be a little bit
overwhelming for me if it really happens. So, I'll put that on hold for now
until we have more port examples and until we can confirm that these issues
with the version update are indeed happening.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45?email_source=notifications&email_token=AA4GADCBGWFUNCP2VBS5AZLPXUMUDA5CNFSM4HP3SZX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWL4IQA#issuecomment-496485440>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA4GADBDGXXLUDM6LL3YJZLPXUMUDANCNFSM4HP3SZXQ>
.
|
@villares I had a few second thoughts on that! Now I really agree with this tool as a somehing to bring more people to use and to try Anyway, what do you think about this one? What do you think about something like:
|
Hey, if you could provide me an entry point where my converter should run... Or maybe, better, If I implement an independent |
Sure! Feel free to implement a |
This is a proof of concept, running inside Processing IDE, that converts simple 'single tab' code for use with pyp5js:
https://gist.github.com/villares/1b14997beef52de34069b91752faef40
@berinhard suggested some CL ideas:
$ pyp5js from_processing /path/to/sketch.pyde
or
$ pyp5js from_processing /path/to/sketch.pyde -s my_new_sketch
(the last one would update a sketch with the converted code)
The text was updated successfully, but these errors were encountered: