Closed lorenzobernardi closed 7 years ago
As far as I see, pexpect is not meant to be used under windows with full compatibility. See https://pexpect.readthedocs.org/en/stable/overview.html#windows
Pexpect on Windows New in version 4.0: Windows support
Pexpect can be used on Windows to wait for a pattern to be produced by a child process, using pexpect.popen_spawn.PopenSpawn, or a file descriptor, using pexpect.fdpexpect.fdspawn. This should be considered experimental for now.
pexpect.spawn and pexpect.run() are not available on Windows, as they rely on Unix pseudoterminals (ptys). Cross platform code must not use these.
Thank you. Any solutions? Can i solve using some unix emulater, like git bash or other?
You should ask the pexpect experts, but would not expect this to be solvable easily. I use therefore a VM with Linux inside, since Windows never was a good choice for doing using science tools.
Thanks for the contributions! I'm not using IDL or Python these days, but (1) happy to receive contributions to the code, and (2) it seems that there is a built-in IDL/Python bridge these days, which seems to support Windows: http://www.exelisvis.com/docs/Python.html. Just discovered that today: anyone used it?
Thanks, will try it next time needed.
Dear all, my aim is to use the script written in IDL, in python:
IDL code:
PRO PS_GS
; Start the application
e = ENVI()
;Generate the roi from a vector file
; Open a vector file
file_vec = Filepath('Sic_Trapani.shp', ROOT_DIR = 'E:\mydirectory\')
vettore = e.OpenVector(file_vec)
; Get the task from the catalog of ENVITasks
Task_VtoR = ENVITask('VectorRecordsToROI')
; Define inputs
Task_VtoR.INPUT_VECTOR = vettore
; Define outputs
Task_VtoR.OUTPUT_ROI_URI = Filepath('roi_roi.xml', ROOT_DIR = 'E:\mydirectory\')
;Run the task
Task_VtoR.Execute
END
The above code works correctly.
I'm trying with the simple following code:
from idlpy import IDL
import numpy.random as ran
e = IDL.ENVI()
#Generate the roi from a vector file
# Open a vector file
file_vec = IDL.Filepath('Sic_Trapani.shp', ROOT_DIR = """E:\\mydirectory\\shp\\""")
vettore = e.OpenVector(file_vec)
#Get the task from the catalog of ENVITasks
Task_VtoR = IDL.ENVITask('VectorRecordsToROI')
#Define inputs
IDL.Task_VtoR.INPUT_VECTOR = vettore
#Define outputs
Task_VtoR.OUTPUT_ROI_URI = IDL.Filepath('roi_roi.xml', ROOT_DIR = """E:\\mydirectory\\""")
#Run the task
IDL.Task_VtoR.Execute
I have several doubts about the:
e=IDL.ENVI()
vettore = e.OpenVector(file_vec)
lines and the IDL.Task using sintax. Perhaps it would be better to use the python library to read the raster and the vector file and to extract the numeric information to be passed to the IDL.Task functions. Any suggestions? I will inform you about future developments or solutions.
Lorenzo
loreberna@gmail.com
Update:
I have tryed:
IDL.ENVI()
vector=IDL.ENVI().OpenVector(file_vec)
The result is the following error message:
Impossible find the access point ??0LTISceneBuffer@LizardTech@@QEAA@AEBVLTIPixel@1@IIPEAPEAX@Z into the dynamic link library lti_DSDK.dll
Like arab for me!! I googled the error and i found this site: Malware scan of envi_gdal.dll. Any suggestion? Thanks
Not sure this is related to pidly any more... try posting on stackoverflow?
i did. No answer. it is a problem related to working with python and idl, but you are right. Thank you
I'm going to close this... re-open if appropriate!
Hi all, I'm trying to execute the following simple python script:
I have the following problem:
I have already correctly installed pidly and pexpect modules with the command:
pip install pidly pexpect
and my working environment is:How can i solve this problem? Thank you for any suggestion. Lorenzo