Blog

BoxLang Unleashes the Power of Python: Introducing bx-jython!

Maria Jose Herrera June 19, 2024

Spread the word

Maria Jose Herrera

June 19, 2024

Spread the word


Share your thoughts

BoxLang Unleashes the Power of Python: Introducing bx-jython!

BoxLang, the dynamic, modular, and productive scripting language, just got even better with the introduction of bx-jython! This powerful new feature enables seamless integration of Python code within your BoxLang scripts.

Unlocking Python's Potential in BoxLang

bx-jython allows you to:

  • Execute Python Code Directly: Embed Python code snippets within your BoxLang scripts using the jythonEval(code) function. Need to print a simple message? Just use jythonEval("print('Hello, World!')");
  • Leverage Existing Python Assets: Effortlessly reuse your Python libraries, files, and modules within BoxLang. Employ the jythonEvalFile(path) function to integrate external Python code.
  • Create Reusable Python Components: Develop Python modules and classes that seamlessly work within your BoxLang environment. The jythonEvalFile(path) function empowers you to integrate custom Python functionalities.
  • Streamlined Templating with <bx:jython>: Utilize the <bx:jython>{python code}</bx:jython> tag for embedding Python code directly into your BoxLang templates.

Examples to Ignite Your Creativity

The blog post can showcase these functionalities with practical examples:

  • Simple Python Execution: Print a message using jythonEval().
  • Integrating Python Files: Call a Python function defined in a separate file using jythonEvalFile().
  • Building Reusable Modules: Create a Python module within BoxLang and demonstrate its usage.
  • Templating with <bx:jython>: Craft a template that incorporates Python code for calculations and dynamic content.

Effortless Binding and Results

BoxLang automatically binds variables within your BoxLang script to the Python engine, allowing you to use them directly within your Python code. Each execution of Python code returns a result containing references to the engine, global scope, and engine scope for advanced use cases.

BoxLang: A Community-Driven Project

BoxLang's development flourishes thanks to the incredible support of the community and Ortus Solutions. Try boxlang today and be part of the movement.

bx-jython opens a world of possibilities for BoxLang developers. With the ability to leverage the vast Python ecosystem, BoxLang empowers you to tackle complex tasks and streamline your development workflow. Dive into BoxLang's documentation  to explore bx-jython further and unleash the full potential of your scripting endeavors!

Add Your Comment

Recent Entries

Ortus June 2024 Newsletter!

Ortus June 2024 Newsletter!

Welcome to the latest edition of the Ortus Newsletter! This month, we're excited to bring you highlights from our sessions at CFCamp and Open South Code, as well as a sneak peek into our upcoming events. Discover the latest developments in BoxLang, our dynamic new JVM language, and catch up on all the insightful presentations by our expert team. Let's dive in!

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang June 2024 Newsletter!

BoxLang June 2024 Newsletter!

We're thrilled to bring you the latest updates and exciting developments from the world of BoxLang. This month, we're diving into the newest beta release, introducing a new podcast series, showcasing innovative integrations, and sharing insights from recent events. Whether you're a seasoned developer or just getting started, there's something here for everyone to explore and enjoy.

Maria Jose Herrera
Maria Jose Herrera
June 28, 2024
BoxLang 1.0.0 Beta 3 Launched

BoxLang 1.0.0 Beta 3 Launched

We are thrilled to announce the release of BoxLang 1.0.0-Beta 3! This latest beta version is packed with exciting new features and essential bug fixes, including robust encryption functionality, enhanced Java interoperability, and more efficient event handling. Key highlights include the introduction of query caching capabilities, seamless coercion of Java Single Abstract Method (SAM) interfaces from BoxLang functions, and support for virtual thread executors. So, let’s dive into the details of what’s new in BoxLang 1.0.0-Beta 3 and how you can start leveraging these updates today!

Luis Majano
Luis Majano
June 28, 2024