Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dist/linux/pyj
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PYJAVA_PATH=$(command -v pyjava.jar | cut -d' ' -f2)
java -jar "$PYJAVA_PATH" "$@" &&
python "${1%.pyj}.py"
5 changes: 5 additions & 0 deletions dist/readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Put corresponding to your os file pyj into needed directory
2. Add path/to/pyjava.jar, path/to/java.exe, path/to/python.exe into $PATH env var
3. Make pyj cmdlet (e.g. using chmod +x)
4. Use it like pyj script.pyj <args>
5. It will automatically compile it with PyJava and run with Python
6 changes: 6 additions & 0 deletions dist/windows/pyj
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
for /f "tokens=2" %%a in ('where /R %~dp0 pyjava.jar') do set PYJAVA_PATH=%%a
java.exe -jar "%PYJAVA_PATH%" %* && (
set PY_SCRIPT=%1
python.exe "%PY_SCRIPT:.pyj=.py%"
)
4 changes: 4 additions & 0 deletions dist/wsl/pyj
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PYJAVA_PATH=$(whereis -b pyjava.jar | cut -d' ' -f2)
PYJAVA_PATH=$(echo "$PYJAVA_PATH" | sed -E 's|/mnt/([a-z])/|\1:/|')
java.exe -jar "$PYJAVA_PATH" "$@" &&
python.exe "${1%.pyj}.py"