Since it was announced by Google in 2021, Jetpack Compose has quickly emerged as a widely used toolkit in Android UI development of native applications. From an engineer’s view, this simplifies UI creation and improves efficiency by reducing the code amount.
In Jetpack Compose, each component that needs to be rendered on the screen can be defined as a Kotlin Unit function marked with the @Composable annotation. We call those functions composables. Every time the value changes, the UI will be updated to reflect the updated values. This is what we call recomposition. You may only call composable functions from other composable functions. Because of this, activities that use Composable to render their layouts will look like this:
PyScript is a framework invented to provide users with an opportunity to create Python applications directly in the browser. We can write the code directly in an HTML interface thanks to Pyodide, Wasm, and other modern web technologies. These are the six basic components:
With Py-config we can configure metadata and define dependencies needed for PyScript applications. Configuration is possible in TOML and JSON formats and we should place it within the <body> tag.
Attributes:
Read Eval Print Loop is an interactive Python framework that runs multiple code lines. If we print any of the REPL elements – the output will be shown at the py-terminal.
Attributes:
Allows running Python scripts whether in code or in a specific folder imported by src attributes.
Attributes:
This is one of the core plug-ins, and it’s active by default. It is used for printing across stdout and stderr and for listing export data on the py-terminal page.
By launching the PyScript project, now we have a choice to use the language we prefer. The best thing is that we don’t even have to decide about only one of them because PyScript allows us to use JavaScript libraries. This makes JavaScript and PyScript compatible. The only weakness may be the download duration, so in some cases, PyScript would not be the best choice.
If you ask if PyScript tends to replace JavaScript, the answer would be no. This framework should give extra value and increase flexibility for all Python users. In cases where one would never use HTML, CSS, and JavaScript, now have the motivation to combine benefits from both languages.
This blog post was written by our software engineer Tamara Glišić.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!