Python Forum
I made a package to quickly create live-update GUIs for Python using Markdown
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I made a package to quickly create live-update GUIs for Python using Markdown
#1
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
Reply
#2
I have seen this project on latest Pycoders Weekly newsletter :-)
Reply
#3
Ahh, awesome. I didn't know it made it into that newsletter.
Reply
#4
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>

`python
print('Hello {}!'.format(your_name))
`

</section-live>"""

create_file(filename, markdown_contents)
sf.load(filename)
Reply
#5
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Star I made a Twitch Dashboard in Python. ybk1ml 1 2,059 Jan-06-2022, 11:08 PM
Last Post: lucasbazan
  Guietta – Python module to create simple GUIs alfiopuglisi 1 2,551 Jul-07-2020, 09:54 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020