Quesion about running a exe file in Python(Not enough memory)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Apr 25 18:00:06 EDT 2013


On Thu, 25 Apr 2013 14:18:58 -0700, yuyaxuan0 wrote:

> Hey guys,
> 
> I have a python script that will call an external exe file. Code is kind
> of like this:

"Kind of like"? So it might be different? How much different?

[snip irrelevant code]

Please try to cut your code down to the minimum necessary to demonstrate 
the problem.


>     #cmd = "D:\\programs\\MIRAX_SlideAC_SDK\\Bin\\MrxSlideExport.exe -s
>     D:\\fit\\projects\\bayer\\KidneyLiver\\MiraxScanner\\Slides\\L10 -e
>     -o D:\\fit\\projects\\bayer\\KidneyLiver\\MiraxScanner\\Output\\L10
>     -z 5 -f png" 

You can simplify Windows pathnames by using forward slashes.


>     #os.system(cmd)
>     #msg = os.popen(cmd, mode='r', buffering=-1) # does not work
>     #print(msg)

Of course it does not work. You have commented it out.


>     # run through slices in given source-path
>     cmd = cmdForExportingSlicesToTiles + " -s " + slicePath + " -o " +
>     pathToResultData 
>     print(cmd)
>     os.system(cmd)
> 
> So the problem is that is says it doesn't have sufficient memory.

What says "it" doesn't have sufficient memory? What's "it"? You may have 
seen the error, but we haven't. Please COPY AND PASTE the exact error 
message, IN FULL, and describe where it comes from:

* is it a Python traceback?

* something printed directly to the terminal but not a traceback?

* Blue Screen of Death?

* a message in a GUI alert?

* something else?



> The weired thing is that if I just ran the exe file directly in cmd
> console, it's working without any memory problem. I am wondering whether
> if it's some kind of python issue limits the memory that we can use??

No.



-- 
Steven



More information about the Python-list mailing list