Python with web interface

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Create web-based user interfaces with Python. The nice way.

License

zauberzeug/nicegui

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Try online!

NiceGUI is an easy-to-use, Python-based UI framework, which shows up in your web browser. You can create buttons, dialogs, Markdown, 3D scenes, plots and much more.

It is great for micro web apps, dashboards, robotics projects, smart home solutions and similar use cases. You can also use it in development, for example when tweaking/configuring a machine learning algorithm or tuning motor controllers.

NiceGUI is available as PyPI package, Docker image and on conda-forge as well as GitHub.

  • browser-based graphical user interface
  • implicit reload on code change
  • acts as webserver (accessed by the browser) or in native mode (eg. desktop window)
  • standard GUI elements like label, button, checkbox, switch, slider, input, file upload, .
  • simple grouping with rows, columns, cards and dialogs
  • general-purpose HTML and Markdown elements
  • powerful high-level elements to
    • plot graphs and charts,
    • render 3D scenes,
    • get steering events via virtual joysticks
    • annotate and overlay images
    • interact with tables
    • navigate foldable tree structures
    python3 -m pip install nicegui

    Write your nice GUI in a file main.py :

    from nicegui import ui ui.label('Hello NiceGUI!') ui.button('BUTTON', on_click=lambda: ui.notify('button was pressed')) ui.run()

    The GUI is now available through http://localhost:8080/ in your browser. Note: NiceGUI will automatically reload the page when you modify the code.

    Documentation and Examples

    The documentation is hosted at https://nicegui.io/documentation and provides plenty of live demos. The whole content of https://nicegui.io is implemented with NiceGUI itself.

    You may also have a look at our in-depth examples of what you can do with NiceGUI.

    We at Zauberzeug like Streamlit but find it does too much magic when it comes to state handling. In search for an alternative nice library to write simple graphical user interfaces in Python we discovered JustPy. Although we liked the approach, it is too «low-level HTML» for our daily usage. But it inspired us to use Vue and Quasar for the frontend.

    We have built on top of FastAPI, which itself is based on the ASGI framework Starlette and the ASGI webserver Uvicorn because of their great performance and ease of use.

    Thank you for your interest in contributing to NiceGUI! We are thrilled to have you on board and appreciate your efforts to make this project even better.

    As a growing open-source project, we understand that it takes a community effort to achieve our goals. That’s why we welcome all kinds of contributions, no matter how small or big they are. Whether it’s adding new features, fixing bugs, improving documentation, or suggesting new ideas, we believe that every contribution counts and adds value to our project.

    We have provided a detailed guide on how to contribute to NiceGUI in our CONTRIBUTING.md file. We encourage you to read it carefully before making any contributions to ensure that your work aligns with the project’s goals and standards.

    If you have any questions or need help with anything, please don’t hesitate to reach out to us. We are always here to support and guide you through the contribution process.

    Included Web Dependencies

    See DEPENDENCIES.md for a list of web frameworks NiceGUI depends on.

    Источник

    How to build a web UI with Python

    Anvil lets you build your app’s front-end entirely in Python — no HTML, CSS or Javascript required. You can build your UI by dragging and dropping components in Anvil’s visual designer or by adding components using Python code:

    Let’s look at how you can use the Anvil editor to create a user interface by turning this app into a “hello world” app that says hello to your users.

    In the middle of the Anvil IDE is the Form Editor which is split into the Design View and the Code View. On the right of the Anvil editor you will find the Toolbox.

    You can drag and drop components, like Labels, from the toolbox to build your user interface. This hello world app will also need a TextBox for users to enter their name:

    To configure components, you can edit their properties on the right hand side in the Properties Panel. This includes both the information the component displays and its styling:

    Every component is a Python object, so you can also set the component’s properties in the Form Editor’s Code View:

    All components have events they can raise. For example, when a user of your app clicks a Button component it raises a click event. We can create a Python method in the Code View to be called when this happens. In your Button’s click method, you can call Anvil’s alert function to display an alert that says hello to your users:

    When you’ve finished your app, all you have to do is test it and use Anvil’s two-click deployment to publish it online for people to use. Your users can now enter their name and clicking the say hi button displays the alert:

    Using the drag and drop designer isn’t your only option for building user interfaces in Anvil. You can also create and add components to your user interface directly in code:

    Anvil comes with all the usual UI components — buttons, text boxes, drop-downs, tables, and so on. And if that’s not enough, you can create your own custom components and share them with other applications.

    To learn more about creating user interfaces with Anvil, why not get started with our 10 minute Feedback Form Tutorial?

    Build your own app with Anvil

    If you’re new here, welcome! Anvil is a platform for building full-stack web apps with nothing but Python. No need to wrestle with JS, HTML, CSS, Python, SQL and all their frameworks – just build it all in Python.

    Want to build an app of your own? Get started with one of our tutorials:

    Data Dashboard

    In this tutorial, you will learn to plot data using client-side Python code and deploy it online for others to see.

    Источник

    Saved searches

    Use saved searches to filter your results more quickly

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

    Use any web browser as GUI, with Python in the backend and HTML5 in the frontend.

    License

    webui-dev/python-webui

    This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

    Name already in use

    A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

    Sign In Required

    Please sign in to use Codespaces.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching Xcode

    If nothing happens, download Xcode and try again.

    Launching Visual Studio Code

    Your codespace will open once ready.

    There was a problem preparing your codespace, please try again.

    Latest commit

    Git stats

    Files

    Failed to load latest commit information.

    README.md

    Use any web browser as GUI, with Python in the backend and HTML5 in the frontend, all in a lightweight Python pypi package.

    ScreenShot

    • Fully Independent (No need for any third-party runtimes)
    • Lightweight ~900 Kb for the whole package & Small memory footprint
    • Fast binary communication protocol between WebUI and the browser (Instead of JSON)
    • Multi-platform & Multi-Browser
    • Using private profile for safety
    • Original library written in Pure C

    This text editor example is written in Python using WebUI as the GUI library.

    ScreenShot

    from webui import webui MyWindow = webui.window() MyWindow.show('Hello World') webui.wait()

    Borislav Stanimirov explained at C++ Conference 2019 (YouTube) how beneficial it is to use the web browser as GUI.

    ScreenShot

    Web application UI design is not just about how a product looks but how it works. Using web technologies in your UI makes your product modern and professional, And a well-designed web application will help you make a solid first impression on potential customers. Great web application design also assists you in nurturing leads and increasing conversions. In addition, it makes navigating and using your web app easier for your users.

    Today’s web browsers have everything a modern UI needs. Web browsers are very sophisticated and optimized. Therefore, using it as a GUI will be an excellent choice. While old legacy GUI lib is complex and outdated, a WebView-based app is still an option. However, a WebView needs a huge SDK to build and many dependencies to run, and it can only provide some features like a real web browser. That is why WebUI uses real web browsers to give you full features of comprehensive web technologies while keeping your software lightweight and portable.

    ScreenShot

    Think of WebUI like a WebView controller, but instead of embedding the WebView controller in your program, which makes the final program big in size, and non-portable as it needs the WebView runtimes. Instead, by using WebUI, you use a tiny static/dynamic library to run any installed web browser and use it as GUI, which makes your program small, fast, and portable. All it needs is a web browser.

    Runtime Dependencies Comparison

    WebView Qt WebUI
    Runtime Dependencies on Windows WebView2 QtCore, QtGui, QtWidgets A Web Browser
    Runtime Dependencies on Linux GTK3, WebKitGTK QtCore, QtGui, QtWidgets A Web Browser
    Runtime Dependencies on macOS Cocoa, WebKit QtCore, QtGui, QtWidgets A Web Browser
    OS Browser Status
    Windows Mozilla Firefox ✔️
    Windows Google Chrome ✔️
    Windows Microsoft Edge ✔️
    Windows Chromium ✔️
    Windows Yandex ✔️
    Windows Brave ✔️
    Windows Vivaldi ✔️
    Windows Epic ✔️
    Windows Opera coming soon
    Linux Mozilla Firefox ✔️
    Linux Google Chrome ✔️
    Linux Microsoft Edge ✔️
    Linux Chromium ✔️
    Linux Yandex ✔️
    Linux Brave ✔️
    Linux Vivaldi ✔️
    Linux Epic Does Not Exist
    Linux Opera coming soon
    macOS Mozilla Firefox ✔️
    macOS Google Chrome ✔️
    macOS Microsoft Edge ✔️
    macOS Chromium ✔️
    macOS Yandex ✔️
    macOS Brave ✔️
    macOS Vivaldi ✔️
    macOS Epic ✔️
    macOS Apple Safari coming soon
    macOS Opera coming soon
    Language Status Link
    C/C++ ✔️ WebUI
    Python ✔️ Python-WebUI
    TypeScript / JavaScript ✔️ Deno-WebUI
    Go ✔️ Go-WebUI
    Rust Not Complete Rust-WebUI
    V ✔️ V-WebUI
    Nim ✔️ Nim-WebUI
    Zig Not Complete Zig-WebUI

    Источник

    Читайте также:  Php class parameters passed
Оцените статью