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 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:

.\install_dependencies.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.2.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.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_crosslang-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d8f961195420491fccdecf8a15b4249b6923aa6638363adcdfc8920870a38379
MD5 c115b56c68bae948d205f04ec24b634b
BLAKE2b-256 7a71681b74bd2410e322536ffd0020310d2feb06d71d2415329cb4eb1fea35c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_crosslang-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea53c92f0b78669f2d9c91b897659c60c55cd2f38672b13979a875e7951e411d
MD5 6c037f2add54e4a4c34c2cceeafe26a0
BLAKE2b-256 1e33a39fc1368c3d2d0c12a1c63271acb5c6f81a1334e588968e028c1cbcf0ef

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