Created
September 30, 2015 20:20
-
-
Save gthank/f531b724c969c26f6d8c to your computer and use it in GitHub Desktop.
An example of some Jython for doing File IO stuff in Java and Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from org.python.core.io import FileIO, FileUtil | |
path = "/tmp/hello_world.txt" | |
python_fio = FileIO(path, "r") | |
java_is = python_fio.asInputStream() | |
python_file = FileUtil.wrap(java_is) | |
workbook = jxl.Workbook.getWorkbook(java_is) | |
# Do stuff with your Pythonic file interface here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment