Python for JBang - Java Script in your Python
Project description
jbang-python - Java Script in your Python
Install and use JBang from Python-based projects.
Lets you use your own local scripts, JBang AppStore alias or any network reachable jar or Maven artifact.
Usage
The jbang.exec()
function accepts a string that will be passed as the command-line arguments to the jbang
executable.
Given this script test.py
:
#! /usr/bin/env python
import jbang
jbang.exec('properties@jbangdev')
Now you can invoke the test
script from the command-line:
python test.py
You can easily pass command-line arguments around:
import sys
args = ' '.join(sys.argv1:])
jbang.exec('com.myco.mylib:RELEASE ' + args)
So now if you run python test.py arg1 arg2
, arg1 arg2
will be appended to the command executed.
Behind the scenes
When you run pip install
- JBang and other dependencies will be installed. This uses the app setup
command.
Opening a new terminal or shell may be required to be able to use the jbang
command from the system PATH
.
Similar projects
- jgo - allows execution of Maven artifacts by using Maven.
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
Built Distribution
File details
Details for the file jbang-0.2.1.tar.gz
.
File metadata
- Download URL: jbang-0.2.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb6c84ffc5e7a7e7771ac1a225adb1c5e21d128f4e09ee780b676f7ba6f508ce |
|
MD5 | 2184020ddf900b432f161c6ed3a8c1ba |
|
BLAKE2b-256 | e2f1281d86686b8c619bc9b38abc7e5f0b355df7ea45bef9c36ce5f7dd072552 |
File details
Details for the file jbang-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: jbang-0.2.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 472f84e2b2f1737040975d4f22f4e0d1b6687c0dee7370584ac9924104665e8e |
|
MD5 | f009165246baf5dcd7daad1049db59b1 |
|
BLAKE2b-256 | 73606be51e689edc7c811038f1b1d94732c92b1ce642a8e627f41509e1b8c50f |