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.0.tar.gz
.
File metadata
- Download URL: jbang-0.2.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8af4b5a72ea4aef2a0b9086422ae0dc1b81a3bf9e8dc06c7ea5d5416e149c47 |
|
MD5 | 3fa2668a15cbafbb4a5ee0cabebd2bc0 |
|
BLAKE2b-256 | 06fbf2af0e27c2b4696354ddb94403bd7ea327d52975a45d1abd24234a10d926 |
File details
Details for the file jbang-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: jbang-0.2.0-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 | f67825490c4ded06434f98cfd8bf3675ff2891754d75b51226d788ac2a944adc |
|
MD5 | 194ba40c7c7e2bf555e210fe52245d6c |
|
BLAKE2b-256 | 7889d568a0b84e9f382756712119dc811d1cbdb0a3bd7a47ff1b28ffec410c99 |