I made a package to quickly create live-update GUIs for Python using Markdown - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: General (https://python-forum.io/forum-1.html) +--- Forum: Code sharing (https://python-forum.io/forum-5.html) +--- Thread: I made a package to quickly create live-update GUIs for Python using Markdown (/thread-8407.html) |
I made a package to quickly create live-update GUIs for Python using Markdown - SimonBiggs - Feb-19-2018 I made a python package that lets you quickly create live-update GUIs for Python packages using Markdown and a few custom HTML elements. Under the hood it uses the Jupyter Notebook server, Angular, Angular Material, Phosphor and JupyterLab. The repository can be found at: https://github.com/SimonBiggs/scriptedforms If you would like to quickly take scriptedforms for a spin first install it: Quote:pip install scriptedforms Then copy the following into a python prompt: import scriptedforms as sf # workaround for https://github.com/SimonBiggs/scriptedforms/issues/24 def create_file(filename, contents): with open(filename, 'w') as f: f.write(contents) filename = 'quick-start.md' markdown_contents = """ # An example <section-live> <variable-string>your_name</variable-string> ```python print('Hello {}!'.format(your_name)) ``` </section-live>""" create_file(filename, markdown_contents) sf.load(filename)Note that because scriptedforms relies on the jupyter notebook server the above code cannot be run within a jupyter app itself. For example, that means that you cannot use an ipython prompt or a jupyter notebook to run the above code. Then open up quick-start.md in a text editor and make changes. See your GUI live update to the changes. Check out the repo link above for more details on what you can do. I'm keen for any feedback on whether or not you find this useful. Cheers, Simon RE: I made a package to quickly create live-update GUIs for Python using Markdown - buran - Feb-19-2018 I have seen this project on latest Pycoders Weekly newsletter :-) RE: I made a package to quickly create live-update GUIs for Python using Markdown - SimonBiggs - Feb-20-2018 Ahh, awesome. I didn't know it made it into that newsletter. RE: I made a package to quickly create live-update GUIs for Python using Markdown - ysharoiko - Feb-27-2018 Anybody knows what is it? I've installed scriptedforms but when i run test.py I got Error in browser Error While rendering your form an error occured. The error from the Angular compiler is printed below: Error: Uncaught (in promise): Error: Invalid response: 403 Forbidden Error: Invalid response: 403 Forbidden at new ResponseError (http://localhost:8888/scriptedforms/jupyterlab.js:12:2165) at http://localhost:8888/scriptedforms/jupyterlab.js:42:434820 at ZoneDelegate.invoke (http://localhost:8888/scriptedforms/polyfills.js:36:7588) at Object.onInvoke (http://localhost:8888/scriptedforms/angular.js:36:1048) at ZoneDelegate.invoke (http://localhost:8888/scriptedforms/polyfills.js:36:7528) at Zone.run (http://localhost:8888/scriptedforms/polyfills.js:36:2675) at http://localhost:8888/scriptedforms/polyfills.js:43:2054 at ZoneDelegate.invokeTask (http://localhost:8888/scriptedforms/polyfills.js:36:8321) at Object.onInvokeTask (http://localhost:8888/scriptedforms/angular.js:36:950) at ZoneDelegate.invokeTask (http://localhost:8888/scriptedforms/polyfills.js:36:8242) cat test.py #!/usr/bin/env python3 import scriptedforms as sf # workaround for https://github.com/SimonBiggs/scriptedforms/issues/24 def create_file(filename, contents): with open(filename, 'w') as f: f.write(contents) filename = 'quick-start.md' markdown_contents = """ # An example <section-live> <variable-string>your_name</variable-string> `pythonprint('Hello {}!'.format(your_name)) `</section-live>""" create_file(filename, markdown_contents) sf.load(filename) RE: I made a package to quickly create live-update GUIs for Python using Markdown - SimonBiggs - Mar-02-2018 I suspect you're using an old version of the package "notebook" Could you run pip install scriptedforms --upgrade Also, probably best to just post issues on GitHub, they will get the most prominence there. |