I'm having what I believe is a python string issue. The goal is to send a java class an array of File objects from python/Jython. I'm getting a error related to the string path sent to the File constructor. I believe it is because i can't seem to get rid of the double slash. python code below:
from java.io import File
from jarray import array
myPath ='C:\\something\\somethingElse'
onlyfiles = [ abspath(join(myPath,f)) for f in listdir(myPath) if isfile(join(myPath,f))]
jythonArray = array(onlyfiles, String)
temp=array(onlyfiles,File)
I get the error "TypeError: can't convert 'C:\..." to Java.io.File I have also tried .replace('\\','\') in the comprehension to no avail. It works when i just type out the full path in a string and send it to a java.File object. The issue seems to be I can't get rid of the \'s in the path using the comprehension. Any help would be greatly appreciated. thank you!