Skip to main content

A Python library to run code from multiple programming languages.

Project description

CrossLang CrossLang is a Python library that allows developers to run code written in various programming languages directly from their Python scripts. This can be particularly useful for multi-language projects, testing, and automation.

Features Supports multiple programming languages including Rust, C, Java, Ruby, Lua, Go, JavaScript, PHP, Perl, Scala, Shell, Swift, Kotlin, and Haskell. Automatically compiles and runs code snippets. Easy to integrate into existing Python projects. Installation To install CrossLang, you can use pip:

pip install python-crosslang

Installing Compilers and Interpreters CrossLang relies on various external compilers and interpreters to execute code in different languages. You can use the provided installation scripts to set up the necessary dependencies.

For Unix-based Systems (Linux/macOS) Run the following script to install the required compilers and interpreters:

chmod +x debian.sh; ./debian.sh

For Arch Linux Run the following script to install the required compilers and interpreters:

chmod +x arch.sh; ./arch.sh

For Windows Run the following PowerShell script to install the required compilers and interpreters:

.\windows.ps1

Usage Here's an example of how to use CrossLang in your Python script:

from CrossLang import Translator

code = """
fn main() {
    println!("Hello, world!");
}
"""

# Running Rust code
output = Translator('rust', code)
print(output)

code = """
#include <stdio.h>

int main() {
    printf("Hello, World!\\n");
    return 0;
}
"""

# Running C code
output = Translator('c', code)
print(output)

code = """
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
"""

# Running Java code
output = Translator('java', code)
print(output)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_crosslang-0.1.3.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_crosslang-0.1.3-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file python_crosslang-0.1.3.tar.gz.

File metadata

  • Download URL: python_crosslang-0.1.3.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for python_crosslang-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9157ddd1be6ac62cf9eeccb279a68743df87a49e3ca941b243a6e5788c34544b
MD5 9ffe5352d12707b56b3e2d2fc3811c62
BLAKE2b-256 19824645e0e7426e0ef45f1d8c8faf3eaeffb6bd75ac7b46fead735e91d06fc8

See more details on using hashes here.

File details

Details for the file python_crosslang-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for python_crosslang-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bcff5669a1c6106b88c87d03891312fdcb78e56ed4ca909ae3d07cde88b151cf
MD5 9de47f82310fc96c1e1dd20518debb07
BLAKE2b-256 a3135d0b9e1d9e05ba8e5dfbb501c572413e3b5650c1ba7f48e2a2ce6c339cd7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page