-
Notifications
You must be signed in to change notification settings - Fork 507
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
Improve precompile tool #239
Comments
|
Still waiting for those further details :). I tried a few things but could not get it to work at all. How am I supposed to run this? |
|
There is a simple pre-compilation tool aimed at translating Python code to its internal js equivalent . You should be able to use it to build your own VFS file that you can load afterwards. Regarding improvements , we are the ones waiting for users to tell us what needs to be improved in the pre-compilation workflow . |
|
@olemis - I'm still a bit lost.
It looks like |
Well, if you are waiting 😄 , here is what I want from the pre-compilation workflow: $ mkvirtualenv -p `which python3` my-brython-project
$ . my-brython-project/bin/activate
$ pip install brython
$ pip install foo
$ pip install bar
$ pip install baz
$ cat > my_project.py
import foo
import bar
import baz
def do_fun_brython_stuff():
"use foo, bar, baz..."
^D
$ brythonify --package=foo --package=bar --package=baz --script=my_project.py --output=my_project.vfs.js
$ cat > my_project.html
<html>
<script src="my_project.vfs.js" />
<body onload="brython()">
</body>
</html>
^D
$ scp my_project.html my_project.vfs.js my-server.example.com:
$ open https://my-server.example.com/my_project.html |
|
To explain that workflow a bit better: I want to be able to have a tool which does all the work of enumerating all the Python files that need to be translated, translating them, putting them into a I would work on this myself, except I can't figure out how to get to the basic first level of what |
|
Is there any more documentation on this yet? |
|
I've not been able to take a look into this yet . Sorry . I'm hoping to have time to do something about it in the next few days . |
|
Thanks for the update! No need to apologize; I know open source is hard. I am very excited to see what you come up with :). To maybe refine that workflow a little bit: Even better would be for |
|
is it not possible to precompile list comprehension (eg [i*i for i in range(10)]) res = [] |
|
I think we can close this thread, #491 also deals with precompilation. |
Implemented in #222 . Further details TBD .
The text was updated successfully, but these errors were encountered: